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

Re: [pygame] learning pygame: what to focus for a board game?



Laura Creighton ha scritto:

> You definitely can make your tiles to be just surfaces.  But the question
> then becomes, how to you want to create the robbers, monks, townspeople,
> and farmers?  I'd use sprites for them.  Sprites aren't hard to use.

Right. So, I'll definitely look for sprites.

> So first make a
> version of your game that just does the game logic and doesn't
> use pygame at all to start with.  You can do test driven design
> with this and get your logic bugs out first.  Stupid ASCII art
> where you just print 'C1' for castle-picture-1, and 'M1' for
> monestary-with-a-road, and the like will be just fine.  You
> can call something like 'update_screen' and get a grid of
> 2letter tiles, for use when debugging the logic.

This is one of the better advices ever.
You are completely right. I think I'll dig in right that way. It would
lead naturally then to have a, say, "libcarcassonne" that the ascii and
the pygame game can refer to. And a console-based carcassonne sounds
like pure geek fun. :)

> The nice thing is that doing things this way will probably get
> you Model-View-Controller for free.  If you don't know what
> that is, read http://sjbrown.ezide.com/games/writing-games.html
> and then google around for some more until you understand why
> this is a good idea.

Ah, design patterns! Being not a professional programmer (I'm actually a
biophysics ph.d. student) they always escaped me -I tried to have a look
at them but I didn't understand a lot of them. Not that I looked very
thoroughly. I'll surely dig it. Thanks a lot.

> I'm really looking forward to this.  I want to play carcasonne
> with friends on long airplane rides.

Well, I'll do my better. My spare time is what it is, but as soon I have
some code, I'll put it online for people to help me.

By the way: Luke P. adviced me about using Google Code to host the
project. What do you think about?

m.