pygame is
Python
Simple DirectMedia Layer
 
 
pygame.org is
Site Swing
ZombieSim

ZombieSim - v0.1

Josh T (mrbluesky)

Tags:

Description

Ignore this; I'm testing something.

Links

Home Page: http://dl.dropbox.com/u/1300111/ZombieSim.rar
Source: http://dl.dropbox.com/u/1300111/ZombieSim.rar
Windows: http://dl.dropbox.com/u/1300111/ZombieSim.rar

Screenshot


click to view original size

Releases

ZombieSim - v0.1 - Jan 18, 2010

Pygame.org account Comments

If you wish to leave a comment with your pygame.org account, please sign in first.

August 2, 2009 2:42pm - Francesco Mastellone - nickname: (effeemme)
Since you asked for them, a few ideas for improving your code...

As for code style, you should follow PEP 008 (space after comma, avoid single line / multi imports, etc.)
I would also name xdis and ydis to dx and dy instead, as you have in the movement functions.
As for the code itself:
Object is a bit of a bad name for a class. It's not really descriptive and it might lead to confusion over other types of objects. Personally, I'd call it GameObject.
I don't get the move method which then calls moveAxis. Is it an optimization? You might want to split the moveAxis method in its horizontal and vertical parts then.
I personally don't like that Human, Zombie, etc. objects append themselves to their respective lists. This could lead to problems were you ever to move them to different .py modules. You could write make_human and kill_human functions instead.
Doing for human in humans and other such calculations can be heavy on the cpu. You might want to look into spatial hashing, to reduce the number of humans each zombie tests against. Basically, you cut the map into sectors, and in each frame you put references to zombies & other objects in their respective sectors. When you need to check for collisions, or other space-related things, just obtain references from as few sectors as possible.
Hint: sectors can be as simple as a dictionary of sets.

As for my personal opinion... This is nice :)
August 2, 2009 12:23pm - Andy Hanson - nickname: (rhodiumgames)
Cool. Works perfect.
spotlight

 
our projects
pygame.org welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
 
recent releases
Apr 21, 2014


Apr 19, 2014

Apr 16, 2014

Apr 13, 2014

Apr 9, 2014

Mar 18, 2014


Mar 15, 2014


Mar 14, 2014

Mar 13, 2014

... more!
 
for pygame related questions, comments, and suggestions, please see help (lists, irc)