Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by gnx

Hey, I'd like some input on how to handle a situation I have.

I have

F = ground
R = ridge
L = lava
V = wall
@ = player
Let's say a map looks this

F@FF
FFFV
RRRR
LLLL

What would be the most convinient way to set this up so that

1) character can never go through walls
2) character can't normally go through ridges
3) character can jump/fly across ridges, but not walls

All the surfaces will have multiple tile images so using numeric constraints won't work very well :)

My thinking is that I could perhaps have multiple handleMovementTrace functions on the player entity tracking different background maps, but I'm not sure how easily this can be achieved.

Maybe I'm missing something simple? Thoughts?

1 decade ago by dominic

You can always implement your own tiles on the collision map. Everything after tile number 45 is free at your disposal.

Add the tiles to your lib/weltmeister/collisiontiles-64.png image and implement the logic in the player's handleMovementTrace method. I.e. if there was a collision with a ridge tile and the player is jumping, just ignore the collision result and move the player according to his velocity.
Page 1 of 1
« first « previous next › last »