• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GML Top-Down foot direction problem

J

jaber

Guest
Hi all : )
I am facing some troubles with implementing the right direction of the lower part of my charachter (feet steps).

I can move the player in all directions and I am using Keyboard combination (A,D,W,S) with mouse pointer for that.
I am using hspeed and vspeed to move the player and everything is working perfectly.

1598441826148.png

sofar, I am only using one sprite (step_forward) for the foot steps no matter what direction I move the player… but actually I should be using the following additional sprites
step_right
step_left
my problem is, I am not good with vectors and could not solve this puzzle :confused: How can I properly make use of the other sprites (right and left) in regard to player direction (actuall movement direction) ?

I think step_right and step_left sprites should be used whenever the actuall player movement is perpendicular (or almost perpendecular) to the player direction... below u see an example of when should step_right be used
1598527725934.png


sofar I can think of
point_direction(obj_player.x, obj_player.y, mouse_x, mouse_y) (as player direction vector)
built in variable direction (as plyer direction which output the valuse I wrote in the photo below when I use keyboard A,S,D,W )



1598442734974.png

I think Image_angel is not the right thing to be used because it store values beyon the range (0,360)

but as I said, I am just confused and lost and looking for some advice/help

thanks in advance
cheers!
 
Last edited by a moderator:
Top