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

@@ -53,15 +53,19 @@ class GameMenu(object):
int(screen_size[1]*factors[1])))
for img in getattr(self, '%s_imgs' % item)])
def toggle_menu(self):
self.game.level.paused = self.active = not self.active
def update(self, e, t, dt):
for event in e:
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_ESCAPE:
self.active = not self.active
self.toggle_menu()
if self.active:
if event.key in [pygame.K_SPACE, pygame.K_RETURN]:
if self.menu[self.selection] == 'restart_level':
pass
self.game.level.restart()
self.toggle_menu()
if self.menu[self.selection] == 'quit':
self.game.stop()
if event.key == pygame.K_UP: