diff gamelib/constants.py @ 566:a8dde729000a

Add 'Save and Quit' option to quit dialog. Move game events from engine to constants to ease 'import engine' fun
author Neil Muller <drnlmuller@gmail.com>
date Sat, 28 Nov 2009 19:30:06 +0000
parents 7f037ee2a6c8
children 3ec614e6fd4a
line wrap: on
line diff
--- a/gamelib/constants.py	Sat Nov 28 19:15:56 2009 +0000
+++ b/gamelib/constants.py	Sat Nov 28 19:30:06 2009 +0000
@@ -1,5 +1,8 @@
 """Operation Fox Assault constants."""
 
+from pygame.locals import USEREVENT, QUIT
+import pygame
+
 # Project metadata
 
 NAME = "Operation Fox Assault"
@@ -61,3 +64,17 @@
 
 TILE_DIMENSIONS = (20, 20)
 TOOLBAR_WIDTH = 140
+
+
+# Game states
+START_DAY = pygame.event.Event(USEREVENT, name="START_DAY")
+START_NIGHT = pygame.event.Event(USEREVENT, name="START_NIGHT")
+GO_MAIN_MENU = pygame.event.Event(USEREVENT, name="GO_MAIN_MENU")
+GO_HELP_SCREEN = pygame.event.Event(USEREVENT, name="GO_HELP_SCREEN")
+GO_GAME_OVER = pygame.event.Event(USEREVENT, name="GO_GAME_OVER")
+FAST_FORWARD = pygame.event.Event(USEREVENT, name="FAST_FORWARD")
+MOVE_FOX_ID = USEREVENT + 1
+MOVE_FOXES = pygame.event.Event(MOVE_FOX_ID, name="MOVE_FOXES")
+DO_LOAD_SAVEGAME = USEREVENT + 2
+DO_LOAD_LEVEL = USEREVENT + 3
+DO_QUIT = pygame.event.Event(QUIT)