Added the robot with animations to the game. Also made the game pause when using the menu.

This commit is contained in:
Sakse Dalum
2012-08-08 13:26:55 +02:00
parent 28a19d5493
commit ea181b40c0
9 changed files with 92 additions and 32 deletions

View File

@@ -25,8 +25,20 @@ A generic level.
"""
class Level(object):
def update(self, e, t, dt):
def __init__(self, graphics_dir, paused=False):
self.__dict__.update(locals())
def restart(self):
pass
def update(self, e, t, dt):
if not self.paused:
for obj in self.objects:
obj.update(e, t, dt)
def draw(self, window):
pass
for tile in self.tiles:
tile.draw(window)
for obj in sorted(self.objects, key=lambda obj: (obj.y + obj.z)):
obj.draw(window)