[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] How to make a (fast) smooth movement on 30 frames
- To: pygame-users@xxxxxxxx
- Subject: [pygame] How to make a (fast) smooth movement on 30 frames
- From: "Kai Kuehne" <kai.kuehne@xxxxxxxxx>
- Date: Wed, 21 Jun 2006 11:17:10 +0200
- Delivered-to: archiver@seul.org
- Delivered-to: pygame-users-outgoing@seul.org
- Delivered-to: pygame-users@seul.org
- Delivery-date: Wed, 21 Jun 2006 05:17:18 -0400
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=BFap13lJpXaYn5TMtIayhBC2kWmPz/U4C+DHgPKjH/QkI9aysSW9sTjDZZzbpdgHXdDwYCvz4g0hc7bOIzV4rNiTKqSaQfqfohOkYb1K1f4PvGbosSp4lKnzPyWBgMoj7RjWRA02RbJAV5/LhYqO2S+OBhYBanDDQ4MrLC05p5c=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
Hi!
Im currently creating my first game. A simple space shooter.
I have set the frame rate to to 60 with pygame.clock.tick(), but
the game uses more than 90% of my CPU time. That's a problem,
because there is almost nothing on the screen yet (just three ships...).
When I set the framerate to 30, the CPU uses ~30%. I would say,
that's besser. =) But the ships are flying too slow now...
Ok, no problem.. just set the speed to, say, 5 pixels per frame.
Now there as fast as with 60 frames, but there lacking.
How can I use (say) 30 frames and make a smooth movement for
the objects that are on the screen?
If you need code snipplets, I post them later on that day.
Thanks in advance!
Kai