2d top down racer shooter

M

Martin Cpetzee

Guest
Hi there, I am making a 2d top down driver/shooter game. So far, it's going good. However, I cannot gt an desired collision effect with AI opponents on paths. I want a 'spinout' sort of effect. (360 rotation) At the moment, I have this for o_enemy (which is obviously the AI test vehicle):

in Create:

Code:
rspeed = 5;
Point_dir = 0;
Is_Rotating = 0;
in Step even I have:

Code:
image_angle = direction

if (Is_Rotating == 1)
{
     image_angle += sin(degtorad(Point_dir - image_angle))*rspeed;
}
In case of collision with another vehicle:

Code:
Point_dir = image_angle + 270;
Is_Rotating = 1;
Its been a while since Ive used game maker, so Im rusty. That being said, this obviously doesn't work, both objects become stationary when colliding. Any advice would be greatly appreciated! See image for current results

spinnot.png

Thanks in advance
 
Last edited by a moderator:
Top