Gamerev147
Member
Hello! I have a few questions about a recoil system that I want to implement.
Here is a diagram of what I want to happen. More explanation and code is written below the diagram.
Ok so when the player fires, i want the sprite to either snap a few pixels right, left, up, or down depending on the direction that the player is facing at that current moment.
Here is the code I'm using for controlling where the player is facing (at the mouse):
rspeed = 16; //in the create event
So how can I implement this type of recoil? Any ideas?
Thanks!
Here is a diagram of what I want to happen. More explanation and code is written below the diagram.
Ok so when the player fires, i want the sprite to either snap a few pixels right, left, up, or down depending on the direction that the player is facing at that current moment.
Here is the code I'm using for controlling where the player is facing (at the mouse):
Code:
//Smooth Rotation in Step Event
dir = point_direction(x, y, mouse_x, mouse_y);
image_angle += sin(degtorad(dir - image_angle)) * rspeed;
So how can I implement this type of recoil? Any ideas?
Thanks!