[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Help : speed
facelle@tiscali.it wrote:
> Since I want to keep the animation as smooth as possible, I think
> movements must be always by one pixel at a time, so the question is
> WHEN to move characters going at different speeds within the time
> unit.
Moving one pixel at a time is not really reasonable. At 640x480, movement
rates would probably be in the range of 200 pixels per second. That's a lot
of operations per second.
Better to update at a fixed rate (50 times per second would probably be
adequate), moving multiple pixels with each update. If you really need
greater accuracy, interpolate positions between updates.
--
Rainer Deyke - rainerd@eldwood.com - http://eldwood.com