Added the robot with animations to the game. Also made the game pause when using the menu.
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user