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

[pygame] My first game; the design of pacman



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