M
Mikal
Guest
Trying to make a mechanic similar to Ori and the blind forest where the character can hold right click and after a certain amount of time be reflected/knockbacked to the same direction the mouse is facing. I got the timer to work but it shoots my character vertically. Looking for it to shoot both x and y directions towards the mouse. Kind of like a arc or parabola. Any help is appreciated!
What I have for knockback code:
with(oPlayer)
{
direction = point_direction(other.x, other.y, mouse_x, mouse_y);
hsp = lengthdir_x(20, direction);
vsp = lengthdir_y(20, direction);
if(sign(hsp) != 0) image_xscale = sign(hsp);
}
I can show more code if needed
What I have for knockback code:
with(oPlayer)
{
direction = point_direction(other.x, other.y, mouse_x, mouse_y);
hsp = lengthdir_x(20, direction);
vsp = lengthdir_y(20, direction);
if(sign(hsp) != 0) image_xscale = sign(hsp);
}
I can show more code if needed