[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] Struggling with mouse input



Pygame newbie here.  I'm writing what could be considered an
Asteroids-type clone (actually, it's an Odyssey II UFO! clone but nobody
probably remembers OII) and want to turn my ship using the mouse.  Is
there a standard way to do this, or perhaps a sample I could look at? 
Basically, I'm catching MOUSEMOTION events and comparing the X values from
the current and previous frames to determine which direction to turn.

However, the motion is jerky and not very responsive.  By contrast, my
KEYUP/KEYDOWN code to turn the ship works great, so I don't think it's
anything inherent to my ship code.  I'm probably missing something basic
about mouse events.  My code is at home or I would post it, but it's
fairly straightforward as described above.

So I guess what I am asking is, what are best practices for moving a
player/object using the mouse?

Thanks,

Dave Mikesell