[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] side scroller



Michal Wallace wrote:
> I hadn't seen a side-scroller in pygame before (not that I
> spent too much time looking...), so I decided to try one,
> despite what the newbie guide had to say.
> 
> The stick-figure art, physics, and code are all pretty
> rough, and there are no platforms or bad guys (I cobbled
> this together in about 2 hours) but it does seem to show
> that a real run and jump side scroller could work in pygame.
> I didn't even attempt to optimize it, and it runs just fine
> on my old celeron.

looks like you're off to a fairly clean start. i'll warn you that once the 
"full area" is scrolling you'll see more of a performance hit. but the way 
you are doing it now will certainly be as fast as possible using software 
surfaces in SDL.

some warnings though. the way you are managing graphics now is very memory 
intensive. also treating the 'world' as a single graphic means you won't be 
able to use hardware acceleration if it is needed later. (most video cards 
don't suppose such wide images in hardware). currently the image only needs 
about 800k of ram. but if the game is running on a 32bit display (like 
mine) the image will expand to over 3MB when you convert. this is just 
something you'll need to keep in mind. if you fill the full 480 screen with 
pixels and double the width of the level, you'll quickly be at 12MB of ram 
for that background image.

the sidescroller physics are tricky. i've tried a couple times and have 
never gotten them to work. once you add the platforms it is a sticky 
situation. for example, when the jumping character collides with a 
platform, has he hit the edges of the platform, or landed on top. or maybe 
he jumped into the bottom of it with his head? getting that mario-style 
control is a lot of polish work. :]

can't wait to see your next version!


____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org