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

[pygame] How to make a (fast) smooth movement on 30 frames



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