• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

getting the speed of mousemovements

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would have done the same thing that you did. Divide the distance by time.
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic