• Post Reply Bookmark Topic Watch Topic
  • New Topic

getting the speed of mousemovements  RSS feed

 
martin chile
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i want to retrieve the speed the mouse is moving on the screen.
i have tried some time comparisons and devided it through the way the mouse moved during that time, but it didnt satisfy me.
(i want to move some graphics-objects for eg half the time the mouse is passing by.)
has someone experiences with that?
please help me!
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would have done the same thing that you did. Divide the distance by time.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you say you tried distance / time and had problems?
Have you ever looked at RoboCode? It's an IBM sponsored game environment. You write autonomous robots and send them into battle. I bring it up because there are links to source for user-designed robots. Some are very elaborate - thousands of lines of code. I recall seeing strategies to track opponent observed speed and direction so you can "lead" when shooting. It may be a long dig to find it, but I'm sure there are examples of such things out there.
http://robocode.alphaworks.ibm.com/home/home.html
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!