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

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



Hi Farai,

On 3/20/06, Farai Aschwanden <fash@xxxxxxxxxx> wrote:
> Hi Kai
> See inside...
>
>> [ Moving, Blitting]
> => What you probably want to say is that you would like to work in
> the pure OO way, like in Java or C/C++. Python is highly dynamic and
> easy to use. You don't need to care about creating new instances of
> the same object like you do in the mentioned OO languages, Python
> references to the newly created objects (ghosts), you don't need to
> create an expl

Hmm, i don't know what you mean.
Do you mean "new instances of the same class"?


> If you want to make it more complicated, check the class Thread. ;)
> The Ghosts are all of the same type of object, they only differ in
> their coordinates. So why making it more complicated?

I don't know how to make it easier.
When i hit a 'G' in the List, i replace it with a Ghost-Object:

if c == 'G':
    c = Ghost()


> => There is no right and wrong way, its all up to you and how much
> work you want to spend into it to finish it. Some ways needs of
> course more time than others.

Hm, i think I will make a master-class.
Otherwise every object have to know where the other objects are.


> > Second question:
> > [How about a background list?]
> => You always know the positions of the ghosts and also of the Pacman
> (f.e. in a list) . The only thing you have to do is to use collision
> detection or to ask if the coordinates of the Pacman is close or
> equal to any other existing ghost. This can be done very easily in
> Python.

Ok, that's a great thing. Thank you.


> => Good luck on working it. Sure there would be easier games as for
> the first project but people need challenges. ;) And its also
> interesting to walk into to the steps of minds who created such games
> 20 or 30 years ago. ;)

Thanks for you answer.
Kai