This project is a fun introduction to pyGame and game development. It's currently a WIP, pull requests welcome!
apt-get install python-pygame
python game.py
- Left mouse button adds creeps at pointer.
- Mouse button four and five (wheel scroll up/down) changes type added.
- any key quits
This is just a simple launcher.
Creep.py
is the main game code.
CreepGame
class is the game, the main game loop is inCreepGame.runGame
.
def runGame(self):
while True:
time_passed = self.clock.tick(self.fps)
self.handleInputEvents()
self.updateCreeps(time_passed)
self.drawEverything()
return
Event handlers are hooked up to events in
CreepGame.handleInputEvents
.
Creep
class is the creep itself,CreepType
class is for creating types of creeps.This is the method called by the game loop to allow the creep to do its stuff, it just moves around.
this is the method called from the game loop to handle interactions for every combination of two creeps in the creeps collection. This is where all the proximity and collision behaviour is handled.
vec2d is useful for vector arithmetic.
- @killerbees initial commit
- ...