Wall detection / Grid (help)
larin555
Member Posts: 14
How can I make a block detect that if there's the actor "wall" to his left or right, it won't move (block.position.X + 40 for instance)...Or if there's ground under it, it won't move.
The block uses gravity btw.
I'm using Codemonkey's grid demo.
Thanks a lot!
The block uses gravity btw.
I'm using Codemonkey's grid demo.
Thanks a lot!
Comments
I'm using Codemonkey's grid demo.
I have put walls all around the scene.
Here, you can see how it looks like :
http://img820.imageshack.us/img820/7304/capturedcran20101210174.png
The orange square is the main actor.
Blue = Pushable block
Green = Removable ground (only removable when the main actor collides with it)
That's pretty much it.
Like I said, i'm using codemonkey's grid demo. So when the character moves, it change his position to +40.
I would like to know how can I make the character detect if there's something to his left/right/top/bottom.
So depending on what the object is, he can move or not.
I want it to not be able to go (let's say) x-40 or x+40 if there's the WALL actor to his left or right.
Thanks a lot
I'm not sure to understand how to use the magnitude demo in my game.
Can you try to explain it a little bit please?
I forgot to specify that the main actor doesn't have gravity. The pushable block does...but the main actor doesn't.
Thank you