[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] Struggling with mouse input
- To: "Pygame Users Mailing List " <pygame-users@seul.org>
- Subject: [pygame] Struggling with mouse input
- From: "Dave Mikesell" <dm@gildedring.com>
- Date: Wed, 1 Dec 2004 08:24:44 -0500 (EST)
- Delivered-to: archiver@seul.org
- Delivered-to: pygame-users-outgoing@seul.org
- Delivered-to: pygame-users@seul.org
- Delivery-date: Wed, 01 Dec 2004 08:25:58 -0500
- Importance: Normal
- Reply-to: pygame-users@seul.org
- Sender: owner-pygame-users@seul.org
- User-agent: SquirrelMail/1.4.3a
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