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

Windows Trying to do a slash effect after attacking with sword, but can't get the position right

N

Neuroloq1kk

Guest
Hey
Here's a gif of what I have atm GIF
Here's what I am trying to achieve



When I click the Mouse left, the stick goes from where it is, to where the red rectangle is, and I need the slash animation to appear in the angle between them, how can I achieve this?

This is my code atm

!--------------------------------------------------------------------------------

if (mouse_check_button_pressed(mb_left) && pressed = 0)
{
with(instance_create_depth(x + lengthdir_x(64, image_angle/(image_angle-100)), y + lengthdir_y(64, image_angle/(image_angle-100)),1,oWindSlash))
{
image_speed=1;
}
}
if (mouse_check_button_pressed(mb_left) && pressed = 1)
{
with(instance_create_depth(x + lengthdir_x(64, image_angle/(image_angle+100)), y + lengthdir_y(64, image_angle/(image_angle+100)),1,oWindSlash))
{

image_speed=1;
}
}


!--------------------------------------------------------------------------------
Thanks in advance
 
Top