• 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!

Help with player animation

D

DarlesLSF

Guest
So, I want to make the attack animation of my character, same as the gif below:



I tried to use "move_towards_point" and set the enemies x & y, but the player moves out of the screen. How can I do that?
 

Soso

Member
The reason your player moves off screen is cause you didn't tell the player object to stop when it got there
you need to use distance_to_point

Code:
if (your condition for moving the player)
 { move_torwards_point(x,y,o_enemy; }

if (distance_to_point(x,y,o_enemy)  < 16)
 { speed = 0;
   //some other action you need ; }
 
D

DarlesLSF

Guest
The reason your player moves off screen is cause you didn't tell the player object to stop when it got there
you need to use distance_to_point

Code:
if (your condition for moving the player)
 { move_torwards_point(x,y,o_enemy; }

if (distance_to_point(x,y,o_enemy)  < 16)
 { speed = 0;
   //some other action you need ; }
thx man
 
Top