Page 1 of 1

help with walls

PostPosted: Sun Nov 25, 2007 8:12 pm
by crazypotato
how do you keep an actor from moving through walls when it is being controlled by a player? I think physical response is the key but I'm not sure how...

Re: help with walls

PostPosted: Tue Nov 27, 2007 2:48 pm
by tufif
I was having trouble with this in my game, so I made an actor that was just like the walls only thicker and hid it behind the background so you can't see it. That way in the game you see nice thin walls, but the player is reacting to thicker walls that it can't go through but that you never see.

Re: help with walls

PostPosted: Tue Nov 27, 2007 6:06 pm
by Troodon
Note: the physical response works when you collide with the wall, but you never collide with the wall if you move fast enough. Lol, this isn't modern physics, this is because if you move at xvelocity = 4, then your actor moves only in every four pixel. Like this

[X][][][][][][][][][]WALL
[][][][][X][][][][][]WALL
[][][][][][][][][X][]WALL
[][][][][][][][][][]WALL[][][X]

As you can see it never touches the wall. Of course in this example the wall is just one pixel thick. The bigger, the "stronger" it is.