Hi Scirra world
I'm searching the best way to stop a sprite with a 8-direction behavior against solids.
Actually, when my player hit solids with a not horizontal or vertical angle, it rotates randomly and stop after.
I would like to stop my sprite without any rotation, but i don't know how to do.
Can you explain me ?
You can test my game here :
http://www.retro-bruno.com/html5/MecaBoB/MecaBoB.html
EDIT:
Finally, i'v found how to get my player to bounce correctly.
If Player is overlapping SOLIDS at offset ((2* cos(Player.Angle)) , (2* sin(Player.Angle)))
{
Player.Reverse 8-direction;
Player 8-direction setspeed to Player.8direction.MaxSpeed;
FreezeCommands = 1;
Wait 0.4;
FreezeCommands = 0;
}
[/code:2ac49q4s]
FreezeCommands is a global variable. If set to 1, the joystick and keyboard moving events are disabled.