Still need help in colliding with walls.. Reversing the direction is just not doing it :/ Is there any better way of doing this?
Printable View
Still need help in colliding with walls.. Reversing the direction is just not doing it :/ Is there any better way of doing this?
This example I quickly made might help you: http://www.mediafire.com/?dh584b5f3do71rf
This is a very crude example, of course. The character will move leftwards if he is not standing next to a wall, and the same will happen if he tries to move rightwards. If he is accidentally inside of a wall (overlapping) we will move our character outside, and then that's it. The key here is to be creative. Think about what "colliding" with a wall really is. Colliding with a wall, simply put of course, is when the character enters the area of a wall and then steps out. This stops him from passing through the wall.
If you want to get wall collision more accurate and complicated you can study the .mfx extension named "Move Safely".
I hope this helped you.
dude thank you so much
No problem, always happy to help someone.
Happy new year to whoever reads this :D