Changeset 31:3c4db7bba432


Ignore:
Timestamp:
Aug 30, 2009, 6:56:09 PM (11 years ago)
Author:
Simon Cross <hodgestar@…>
Branch:
default
Convert:
svn:b4e93282-eac8-4b8b-b765-0f5d36de2b68@32
Message:

Add 's' as a key for starting the game from the menu.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gamelib/engine.py

    r30 r31  
    33from pgu.engine import Game, State, Quit
    44import pygame
    5 from pygame.locals import USEREVENT, QUIT, KEYDOWN, K_ESCAPE, K_n, K_d
     5from pygame.locals import USEREVENT, QUIT, KEYDOWN, K_ESCAPE, K_n, K_d, K_s
    66
    77from tiles import TILE_MAP
     
    2727            self.game.create_game_board()
    2828            return DayState(self.game)
    29         elif e.type is KEYDOWN and e.key == K_ESCAPE:
    30             return Quit(self.game)
     29        elif e.type is KEYDOWN:
     30            if e.key == K_ESCAPE:
     31                return Quit(self.game)
     32            elif e.key == K_s:
     33                self.game.create_game_board()
     34                return DayState(self.game)
    3135        elif e.type is not QUIT:
    3236            self.game.main_menu_app.event(e)
Note: See TracChangeset for help on using the changeset viewer.