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

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



Depends on how many dirty rects you have versus how many pixels you really need to update.  Even with a starfield, there will be many pixels which stay black from frame to frame.  In my experience, dirty rects almost always helps, unless the dirty rects would take up 80% of the screen.  You can always code it to work with dirty rects, and then it's very easy to test which method is faster by not passing the rects to the update function.  You could even have it use rects until a certain amount of objects are onscreen and then switch methods.  In my shooter test, I am using dirty rects combined with moving objects for the background (instead of a full scrolling background) to keep the framerate up.  Feel like I should really be using opengl though, lol.