by DST » Tue Jul 12, 2011 1:00 am
use
if (Boldar.directional_velocity==-12)
{
xvelocity=0;
}
By using only one =, you were setting it to -12. Also, you have mixed directional_velocity with xvelocity?
Best way is to make a use variable, named something like dir.
Then on keydown, you set dir to something.....0 for right, 1 for up,2 for left, and so on. Then in draw actor, you can assign movement based on what value dir is.
You don't really need a keyup, just set dir to 0 at the END of draw actor. Then next frame, if they've got the key down, it will set it to a number again (use repeat on the keydown).
You can say directional_velocity=12; angle=dir*90;