Win a copy of Zero to AI - A non-technical, hype-free guide to prospering in the AI era this week in the Artificial Intelligence and Machine Learning forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

getting the speed of mousemovements

Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • 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
  • 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.
    Bookmark Topic Watch Topic
  • New Topic