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

Re: [pygame] separating pygame dependent code from general code



Just to weight in, as an old time Python user, new time pygame user.

The thing I love the most about Python is it's flexibility. For my first project, I'm still using everything-in-one file: https://github.com/audiodude/Butterfly-Catcher/tree/basic

You can always refactor. But if you prefactor, you might up with code that it turns out YAGNI (You Ain't Gonna Need It).

So at first, I just had a main(): method. But once I added scoring/timing, I realized the main method need to go into a MainController class. It was a simple refactor at that point....and KISS (keeping it simple, stupid) up until that point let me focus on the game mechanics/logic without getting bogged down in Software Engineering (do you really want to draw a UML diagram for your hobby game? lol)


I tried to update the skellington after the last pyweek based on bugs...
https://bitbucket.org/illume/skellington2011

What an awesome resource! First time hearing about it. Good work!

-Travis



On Wed, Jun 8, 2011 at 4:59 AM, Renà Dudfield <renesd@xxxxxxxxx> wrote:
Hey,

I like the following...

mygame/
mygame/run_game.py
mygame/mygame/__init__.py
mygame/mygame/yourothercode.py
mygame/mygame/data

I tried to update the skellington after the last pyweek based on bugs...
https://bitbucket.org/illume/skellington2011

but there are still a number of improvements that could be made.


cheers,