Page 1 of 1

Mouse movement speed

PostPosted: Fri Mar 04, 2011 11:52 pm
by BloodRedDragon
I was wondering if there is a function that records your mouse speed. I am trying to make a platform game where the player can use to mouse to swing a sword.
I was thinking i could make:
if (x or y velocity >=10); for the mouse speed actor
Change animation, attack+=1; for the player.

But when you have an actor following mouse it doesnt pick up velocity D:

Re: Mouse movement speed

PostPosted: Sat Mar 05, 2011 12:04 am
by AliceXIII
i don't think there is an variable for mouse speed sounds like it would be cool though :P

Re: Mouse movement speed

PostPosted: Sat Mar 05, 2011 12:05 am
by Game A Gogo
here's a way without the need of another actor, simply create this variable "Lxmouse" and "Lymouse" if you want it for the y axis too, and do this:

Code: Select all
somevar=xmouse-Lxmouse;
Lxmouse=xmouse;


in your case it might be this:
Code: Select all
if(abs(xmouse-Lxmouse)>10||abs(ymouse-Lymouse)>10)ChangeAnimation("EventActor","Player_FlyAttack","(none)","(none)",0,0,false);
Lxmouse=xmouse;Lymouse=ymouse;


NOTE
You might want
Code: Select all
Lxmouse=xmouse;Lymouse=ymouse;

in create actor as well... so that it doesn't bug for the first frame