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

Re: [pygame] OK, I'm starting this whole thing over again...



"Charles Joseph Christie II" <sonicbhoc@xxxxxxxxx> asked:
> What do you guys recommend I do if I knew a little programming, but
> wanted to learn better programming practices and specifically a better way
> to handle the drawing of objects? just adding everything to a dirty rect
> list didn't work well last time.

I would suggest you consider those two separable pursuits. Adopting better
programming practices is an investment that will help out in the future,
paying off in maintainable code and flexible, extensible game
architecture. Getting things to appear on the screen is a much more
specific, immediate task, and easier to address on this mailing list.


> Drawing the bullets was a large sticking point for me, and if I could just
> find a way to do that better I think I'd be well off.

It might make sense to just figure out the bullet drawing bug, or it might
make sense to start over from scratch and rebuild everything from the
ground up - it sounds like you're leaning towards starting over already.
I'm not sure how much work you'll be redoing.

For me, I find that writing code a second time goes faster, because I've
learned a lot of lessons. Writing it a third or fourth time is just
tedious, though.


If you want to find examples of other people that are doing similar games,
I'd browse the PyGame games page, specifically the "arcade" category:
http://www.pygame.org/projects/20

Seems like the various "invaders" and even "breakout" games accomplish the
same thing as you're undertaking, so they'd be good references.

Another source of working games is PyWeek - several of those games are
similar to your game idea. One that comes to mind is this one:
http://www.pyweek.org/e/carstunt/

A third reference would be the "aliens" example that comes with the PyGame
source: http://www.pygame.org/download.shtml - that one might be small
enough that it'd be easy to see how the bullet code is being handled
without a lot of other distracting game systems in the way.


-Dave LeCompte