The Daily Click ::. Forums ::. Klik Coding Help ::. detect mouse speed
 

Post Reply  Post Oekaki 
 

Posted By Message

Aptennap



Registered
  23/04/2004
Points
  916
21st April, 2006 at 21:54:13 -

i use tgf.does anyone know how i can make my game detect the mouse speed? i tryed the mouse object but it had compare distance rolled. please help me!

 
Oh sweet mary.

Aptennap



Registered
  23/04/2004
Points
  916
22nd April, 2006 at 17:22:00 -

sorry, i dont understand it. can you please explain it more or make a turorial?

 
Oh sweet mary.

David Newton (DavidN)

Invisible

Registered
  27/10/2002
Points
  8322

Honored Admin Alumnus
22nd April, 2006 at 17:56:51 -

Here's a basic one - it works on the principle that Phizzy mentioned, storing the mouse's position from before each frame and comparing it to the current position. Using smelly trigonometry.

http://wired.st-and.ac.uk/~wong/mousespeed.cca

I'd also like to add that "Sqr" is a silly name for a function that returns the square root.

Image Edited by the Author.

 
http://www.davidn.co.nr - Games, music, living in America

Aptennap



Registered
  23/04/2004
Points
  916
22nd April, 2006 at 19:24:24 -

sorry but i use tgf, can you please make a tutorial for tgf, please?

 
Oh sweet mary.

Aptennap



Registered
  23/04/2004
Points
  916
22nd April, 2006 at 20:36:46 -

oke, i downloaded MMF demo and i saw that it used things that TGF can't handle is there a way to do it with TGF, i don't need to now the exact speed but just that your mouse is moving fast, please.

 
Oh sweet mary.

Aptennap



Registered
  23/04/2004
Points
  916
22nd April, 2006 at 22:14:29 -

can you please do that? please

 
Oh sweet mary.

Teapot

Does he even go here

Registered
  02/10/2003
Points
  2631

VIP Member
23rd April, 2006 at 00:06:28 -

It's like, over a small amount of time, how far has the mouse moved (distance/time=speed). It's not foolproof though.

Image Edited by the Author.

 
n/a

Aptennap



Registered
  23/04/2004
Points
  916
23rd April, 2006 at 06:43:52 -

but what is the distance? mouse x+ mouse y? i really don't know and should i do the time in seconds or in miliseconds?
can you please make a tgf file? please?

 
Oh sweet mary.

Joe.H

Evil Faker

Registered
  19/08/2002
Points
  3305
23rd April, 2006 at 11:48:04 -

the distance would be |mouse x + mouse y|

or square root((Final X - Initial X)² + (Final Y - Initial Y)²)

le simple.

 
My signature is never too big!!!

Aptennap



Registered
  23/04/2004
Points
  916
23rd April, 2006 at 13:30:45 -

so (distance/time=speed),((mouse x+mouse y)/???=speed),oke so what is the time then?

Image Edited by the Author.

 
Oh sweet mary.

Aptennap



Registered
  23/04/2004
Points
  916
23rd April, 2006 at 15:06:27 -

Phizzy, can you please make a tgf example for me?

 
Oh sweet mary.

Aptennap



Registered
  23/04/2004
Points
  916
30th April, 2006 at 18:03:50 -

Anyone? can someone please make tgf example?

 
Oh sweet mary.

Aptennap



Registered
  23/04/2004
Points
  916
1st May, 2006 at 07:31:54 -

oh lol, but will you please still make a tgf example for me?

 
Oh sweet mary.

Noyb



Registered
  31/05/2004
Points
  1117

VIP Member
1st May, 2006 at 08:04:34 -

When I played around with the mouse object, distance rolled seemed to give the number of pixels moved every loop, which is the speed of the mouse. It even set itself to zero when the mouse was stationary. Make a project where the only event is to always set a visible counter to the distance rolled to see for yourself.

 
"Omg. Where did they get the idea to not use army guys? Are they taking drugs?" --Tim Schafer on originality in videogames

Aptennap



Registered
  23/04/2004
Points
  916
1st May, 2006 at 10:59:37 -

now i get it! stuppid of me! thank żou all

 
Oh sweet mary.
   

Post Reply



 



Advertisement

Worth A Click