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

Re: [pygame] My first game; the design of pacman



Kai,

You might want to check out:
http://www.imitationpickles.org/pgu/ -- my game & gui library, quite good for NES-level games such as pac-man, etc.

http://www.imitationpickles.org/tmp/rustic.tgz -- I haven't released it yet (probably won't until end of this year) but it includes an implementation of pac-man.  Unfortunately, the code is not exactly commented, but if you study the pgu/examples/tilevid*.py quite a bit first, reading the pacman code might be fairly readable (they are written in the same style.  The examples explain how & why I do some things.)

Since this is your first game, I'd actually suggest something other than pac-man.  Pac-man is a fairly difficult game to put together.  Some easier ones to try would be "tron" or "nibbles"  .. or even "tetris" . 

Hope that helps!
Phil

Kai Kuehne <kai.kuehne@xxxxxxxxx> wrote:
Hello everyone.

I'm planning to make a remake of the game pacman
in python and pygame. It exists very often,
sure, but it's just fun.

This is my first game so I have several
design problems.

First of all, i have map files.
A map looks something like this:

####################
# #
# #
# P #
# #
# G #
####################

Where 'P' is the Pacman... and so on.
Now I go and read the mapfile into my program
and replace the specific characters with real
objects ("Pacman" in this case). Now I wanted
to add to every object (like Ghost, or whatever)
update and draw methods so that they can draw
"themselves" onto the screen. Or would it be better
to get all the objects and blitting them onto the
screen, after I have moved them?

I'm a bit confused whether there should be a
"Master class" which controls everything or if
every object should take care only about itself.

I decline to use the second version... is this
"the right way" or what would you make *different*?

Second question:
When all the objects ("Wall", "Nothing", "Pacman" and so on) are all
in my list... what's when Pacman hits a Ghost? I know, I should use
a second list. And in this "background" list, there should lie all the
objects, that *don't* move. Right?

My english is not very good, so, if you didn't
understand something.. please ask for it.

Thanks in advance

Kai


Yahoo! Mail
Use Photomail to share photos without annoying attachments.