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

[pygame] Re: Distribution of Work



Why do you need to redraw the entire screen every frame when moving? Couldn't you change the scrolling to work only on certain conditions (like nearing the screen edge)? Or do you move around so much such a case would always be true when moving? I think old DOS games were fast both because they were done in C/Asm and because they had to come up with tricks to avoid making things slow.

Oops, sorry to not include the information.

I am trying to render something like this screenshot:
http://pybrian.sourceforge.net/shot.png

The moving objects are the little man with the hat and the scary black
thingy's. Although in this screenshot, only 3 of them are in the
viewport, that number is larger in the above figures.

When I am moving around, the screen needs to be redrawn every frame so
that it runs at only 10 frames per second. In the example above, about
10 sprites were moving in the viewport simultanuously at the resolution
640x480, and about 20 at 1024x768. When I'm not scrolling, the speed
is much faster, because I don't need to redraw the whole screen. These
figures are for when the whole screen needs to be redrawn every frame:
otherwise, Brian runs at a very respectable speed of 30-50 fps.

I am wondering why it runs slow. Many old dos games were able to run much
faster on a 286. Is that only because they had direct hardware access?
Or is it because they are written in C and am I hitting at a python problem
here?

--
"When Government fears the people, it's liberty. When people fear the
Government, it's tyranny."                   -- Benjamin Franklin

Michael <mogmios@mlug.missouri.edu>
http://kavlon.org