Mercurial > rinkhals
annotate gamelib/constants.py @ 569:3ec614e6fd4a
Replace monolithic sell equipment tool with a tool for each type of equipment.
author | Simon Cross <hodgestar@gmail.com> |
---|---|
date | Sat, 28 Nov 2009 19:59:46 +0000 |
parents | a8dde729000a |
children |
rev | line source |
---|---|
5 | 1 """Operation Fox Assault constants.""" |
2 | |
566
a8dde729000a
Add 'Save and Quit' option to quit dialog. Move game events from engine to constants to ease 'import engine' fun
Neil Muller <drnlmuller@gmail.com>
parents:
561
diff
changeset
|
3 from pygame.locals import USEREVENT, QUIT |
a8dde729000a
Add 'Save and Quit' option to quit dialog. Move game events from engine to constants to ease 'import engine' fun
Neil Muller <drnlmuller@gmail.com>
parents:
561
diff
changeset
|
4 import pygame |
a8dde729000a
Add 'Save and Quit' option to quit dialog. Move game events from engine to constants to ease 'import engine' fun
Neil Muller <drnlmuller@gmail.com>
parents:
561
diff
changeset
|
5 |
6
c0abad23a055
Add start, quit and toggle fullscreen buttons to menu.
Simon Cross <hodgestar@gmail.com>
parents:
5
diff
changeset
|
6 # Project metadata |
c0abad23a055
Add start, quit and toggle fullscreen buttons to menu.
Simon Cross <hodgestar@gmail.com>
parents:
5
diff
changeset
|
7 |
5 | 8 NAME = "Operation Fox Assault" |
9 | |
10 AUTHORS = [ | |
554
46fa3cdfddf4
Add nicks to author list.
Simon Cross <hodgestar@gmail.com>
parents:
549
diff
changeset
|
11 ("Adrianna Pinska", "adrianna.pinska@gmail.com", "Confluence"), |
46fa3cdfddf4
Add nicks to author list.
Simon Cross <hodgestar@gmail.com>
parents:
549
diff
changeset
|
12 ("Jeremy Thurgood", "firxen+rinkhals@gmail.com", "Jerith"), |
46fa3cdfddf4
Add nicks to author list.
Simon Cross <hodgestar@gmail.com>
parents:
549
diff
changeset
|
13 ("Neil Muller", "drnlmuller+rinkhals@gmail.com", "Nitwit"), |
46fa3cdfddf4
Add nicks to author list.
Simon Cross <hodgestar@gmail.com>
parents:
549
diff
changeset
|
14 ("Simon Cross", "hodgestar+rinkhals@gmail.com", "Hodgestar"), |
46fa3cdfddf4
Add nicks to author list.
Simon Cross <hodgestar@gmail.com>
parents:
549
diff
changeset
|
15 ("David Fraser", "davidroyfraser+rinkhals@gmail.com", "Davidf"), |
5 | 16 ] |
6
c0abad23a055
Add start, quit and toggle fullscreen buttons to menu.
Simon Cross <hodgestar@gmail.com>
parents:
5
diff
changeset
|
17 |
c0abad23a055
Add start, quit and toggle fullscreen buttons to menu.
Simon Cross <hodgestar@gmail.com>
parents:
5
diff
changeset
|
18 # GUI constants |
c0abad23a055
Add start, quit and toggle fullscreen buttons to menu.
Simon Cross <hodgestar@gmail.com>
parents:
5
diff
changeset
|
19 |
c0abad23a055
Add start, quit and toggle fullscreen buttons to menu.
Simon Cross <hodgestar@gmail.com>
parents:
5
diff
changeset
|
20 SCREEN = (800, 600) |
c0abad23a055
Add start, quit and toggle fullscreen buttons to menu.
Simon Cross <hodgestar@gmail.com>
parents:
5
diff
changeset
|
21 FG_COLOR = (255, 255, 255) |
397
532f1ea476ff
Make foxes enter buildings, with a seperate count for them
Neil Muller <drnlmuller@gmail.com>
parents:
393
diff
changeset
|
22 PREDATOR_COUNT_COLOR = (255, 100, 0) # Approximately fox coloured |
561
7f037ee2a6c8
Show count of selected chickens in buildings
Neil Muller <drnlmuller@gmail.com>
parents:
554
diff
changeset
|
23 SELECTED_COUNT_COLOR = (0, 128, 235) # Selection highlight colour |
52
0d4799866bcf
Sell chickens and buy fences.
Jeremy Thurgood <firxen@gmail.com>
parents:
6
diff
changeset
|
24 BG_COLOR = (0, 0, 0) |
0d4799866bcf
Sell chickens and buy fences.
Jeremy Thurgood <firxen@gmail.com>
parents:
6
diff
changeset
|
25 |
90
23a8b2e49e9f
Added ability to initialize sound and play sounds, and handle sound not working / file being missing etc
David Fraser <davidf@sjsoft.com>
parents:
80
diff
changeset
|
26 # Mixer constants |
23a8b2e49e9f
Added ability to initialize sound and play sounds, and handle sound not working / file being missing etc
David Fraser <davidf@sjsoft.com>
parents:
80
diff
changeset
|
27 FREQ = 44100 # same as audio CD |
23a8b2e49e9f
Added ability to initialize sound and play sounds, and handle sound not working / file being missing etc
David Fraser <davidf@sjsoft.com>
parents:
80
diff
changeset
|
28 BITSIZE = -16 # unsigned 16 bit |
23a8b2e49e9f
Added ability to initialize sound and play sounds, and handle sound not working / file being missing etc
David Fraser <davidf@sjsoft.com>
parents:
80
diff
changeset
|
29 CHANNELS = 2 # 1 == mono, 2 == stereo |
23a8b2e49e9f
Added ability to initialize sound and play sounds, and handle sound not working / file being missing etc
David Fraser <davidf@sjsoft.com>
parents:
80
diff
changeset
|
30 BUFFER = 1024 # audio buffer size in no. of samples |
23a8b2e49e9f
Added ability to initialize sound and play sounds, and handle sound not working / file being missing etc
David Fraser <davidf@sjsoft.com>
parents:
80
diff
changeset
|
31 FRAMERATE = 30 # how often to check if playback has finished |
23a8b2e49e9f
Added ability to initialize sound and play sounds, and handle sound not working / file being missing etc
David Fraser <davidf@sjsoft.com>
parents:
80
diff
changeset
|
32 |
389
463802281182
Add basic level support (level choosing needs work)
Neil Muller <drnlmuller@gmail.com>
parents:
383
diff
changeset
|
33 # Default values that can be overridden by the levels |
52
0d4799866bcf
Sell chickens and buy fences.
Jeremy Thurgood <firxen@gmail.com>
parents:
6
diff
changeset
|
34 |
389
463802281182
Add basic level support (level choosing needs work)
Neil Muller <drnlmuller@gmail.com>
parents:
383
diff
changeset
|
35 DEFAULT_STARTING_CASH = 1000 |
549
45e03793d41e
Make default starting wood 50, not 0
Neil Muller <drnlmuller@gmail.com>
parents:
447
diff
changeset
|
36 DEFAULT_STARTING_WOOD = 50 |
389
463802281182
Add basic level support (level choosing needs work)
Neil Muller <drnlmuller@gmail.com>
parents:
383
diff
changeset
|
37 DEFAULT_SELL_PRICE_CHICKEN = 10 |
463802281182
Add basic level support (level choosing needs work)
Neil Muller <drnlmuller@gmail.com>
parents:
383
diff
changeset
|
38 DEFAULT_SELL_PRICE_EGG = 5 |
463802281182
Add basic level support (level choosing needs work)
Neil Muller <drnlmuller@gmail.com>
parents:
383
diff
changeset
|
39 DEFAULT_SELL_PRICE_DEAD_FOX = 15 |
463802281182
Add basic level support (level choosing needs work)
Neil Muller <drnlmuller@gmail.com>
parents:
383
diff
changeset
|
40 DEFAULT_TURN_LIMIT = 14 |
463802281182
Add basic level support (level choosing needs work)
Neil Muller <drnlmuller@gmail.com>
parents:
383
diff
changeset
|
41 DEFAULT_GOAL_DESC = 'Survive for 2 weeks' |
463802281182
Add basic level support (level choosing needs work)
Neil Muller <drnlmuller@gmail.com>
parents:
383
diff
changeset
|
42 |
463802281182
Add basic level support (level choosing needs work)
Neil Muller <drnlmuller@gmail.com>
parents:
383
diff
changeset
|
43 DEFAULT_MAX_FOXES = 50 |
463802281182
Add basic level support (level choosing needs work)
Neil Muller <drnlmuller@gmail.com>
parents:
383
diff
changeset
|
44 |
463802281182
Add basic level support (level choosing needs work)
Neil Muller <drnlmuller@gmail.com>
parents:
383
diff
changeset
|
45 # Game constants, still to be made configurable |
463802281182
Add basic level support (level choosing needs work)
Neil Muller <drnlmuller@gmail.com>
parents:
383
diff
changeset
|
46 |
131 | 47 LOGGING_PRICE = 50 |
438
16437cf4a2b8
Trees provide a modicum of cover.
Jeremy Thurgood <firxen@gmail.com>
parents:
433
diff
changeset
|
48 WOODLAND_CONCEALMENT = 10 |
52
0d4799866bcf
Sell chickens and buy fences.
Jeremy Thurgood <firxen@gmail.com>
parents:
6
diff
changeset
|
49 |
389
463802281182
Add basic level support (level choosing needs work)
Neil Muller <drnlmuller@gmail.com>
parents:
383
diff
changeset
|
50 # Toolbar constants |
463802281182
Add basic level support (level choosing needs work)
Neil Muller <drnlmuller@gmail.com>
parents:
383
diff
changeset
|
51 |
447
f04a2490c35f
The sub-toolbar rewrite, the finally not crashing version
Neil Muller <drnlmuller@gmail.com>
parents:
438
diff
changeset
|
52 TOOL_SELECT_CHICKENS = 1 |
f04a2490c35f
The sub-toolbar rewrite, the finally not crashing version
Neil Muller <drnlmuller@gmail.com>
parents:
438
diff
changeset
|
53 TOOL_SELL_CHICKEN = 2 |
f04a2490c35f
The sub-toolbar rewrite, the finally not crashing version
Neil Muller <drnlmuller@gmail.com>
parents:
438
diff
changeset
|
54 TOOL_SELL_EGG = 3 |
f04a2490c35f
The sub-toolbar rewrite, the finally not crashing version
Neil Muller <drnlmuller@gmail.com>
parents:
438
diff
changeset
|
55 TOOL_SELL_BUILDING = 4 |
f04a2490c35f
The sub-toolbar rewrite, the finally not crashing version
Neil Muller <drnlmuller@gmail.com>
parents:
438
diff
changeset
|
56 TOOL_REPAIR_BUILDING = 5 |
f04a2490c35f
The sub-toolbar rewrite, the finally not crashing version
Neil Muller <drnlmuller@gmail.com>
parents:
438
diff
changeset
|
57 TOOL_PLACE_ANIMALS = 6 |
f04a2490c35f
The sub-toolbar rewrite, the finally not crashing version
Neil Muller <drnlmuller@gmail.com>
parents:
438
diff
changeset
|
58 TOOL_LOGGING = 7 |
139
1d73de63bd71
Add basic game over screen
Neil Muller <drnlmuller@gmail.com>
parents:
131
diff
changeset
|
59 |
1d73de63bd71
Add basic game over screen
Neil Muller <drnlmuller@gmail.com>
parents:
131
diff
changeset
|
60 NIGHT_LENGTH = 150 |
312
dd1ffee5ccf5
Use different score tables fot the different modes. Refactor game modes code as a result
Neil Muller <drnlmuller@gmail.com>
parents:
227
diff
changeset
|
61 |
433
8643893635e7
Seperate toolbar and gameboard
Neil Muller <drnlmuller@gmail.com>
parents:
428
diff
changeset
|
62 TILE_DIMENSIONS = (20, 20) |
8643893635e7
Seperate toolbar and gameboard
Neil Muller <drnlmuller@gmail.com>
parents:
428
diff
changeset
|
63 TOOLBAR_WIDTH = 140 |
566
a8dde729000a
Add 'Save and Quit' option to quit dialog. Move game events from engine to constants to ease 'import engine' fun
Neil Muller <drnlmuller@gmail.com>
parents:
561
diff
changeset
|
64 |
a8dde729000a
Add 'Save and Quit' option to quit dialog. Move game events from engine to constants to ease 'import engine' fun
Neil Muller <drnlmuller@gmail.com>
parents:
561
diff
changeset
|
65 |
a8dde729000a
Add 'Save and Quit' option to quit dialog. Move game events from engine to constants to ease 'import engine' fun
Neil Muller <drnlmuller@gmail.com>
parents:
561
diff
changeset
|
66 # Game states |
a8dde729000a
Add 'Save and Quit' option to quit dialog. Move game events from engine to constants to ease 'import engine' fun
Neil Muller <drnlmuller@gmail.com>
parents:
561
diff
changeset
|
67 START_DAY = pygame.event.Event(USEREVENT, name="START_DAY") |
a8dde729000a
Add 'Save and Quit' option to quit dialog. Move game events from engine to constants to ease 'import engine' fun
Neil Muller <drnlmuller@gmail.com>
parents:
561
diff
changeset
|
68 START_NIGHT = pygame.event.Event(USEREVENT, name="START_NIGHT") |
a8dde729000a
Add 'Save and Quit' option to quit dialog. Move game events from engine to constants to ease 'import engine' fun
Neil Muller <drnlmuller@gmail.com>
parents:
561
diff
changeset
|
69 GO_MAIN_MENU = pygame.event.Event(USEREVENT, name="GO_MAIN_MENU") |
a8dde729000a
Add 'Save and Quit' option to quit dialog. Move game events from engine to constants to ease 'import engine' fun
Neil Muller <drnlmuller@gmail.com>
parents:
561
diff
changeset
|
70 GO_HELP_SCREEN = pygame.event.Event(USEREVENT, name="GO_HELP_SCREEN") |
a8dde729000a
Add 'Save and Quit' option to quit dialog. Move game events from engine to constants to ease 'import engine' fun
Neil Muller <drnlmuller@gmail.com>
parents:
561
diff
changeset
|
71 GO_GAME_OVER = pygame.event.Event(USEREVENT, name="GO_GAME_OVER") |
a8dde729000a
Add 'Save and Quit' option to quit dialog. Move game events from engine to constants to ease 'import engine' fun
Neil Muller <drnlmuller@gmail.com>
parents:
561
diff
changeset
|
72 FAST_FORWARD = pygame.event.Event(USEREVENT, name="FAST_FORWARD") |
a8dde729000a
Add 'Save and Quit' option to quit dialog. Move game events from engine to constants to ease 'import engine' fun
Neil Muller <drnlmuller@gmail.com>
parents:
561
diff
changeset
|
73 MOVE_FOX_ID = USEREVENT + 1 |
a8dde729000a
Add 'Save and Quit' option to quit dialog. Move game events from engine to constants to ease 'import engine' fun
Neil Muller <drnlmuller@gmail.com>
parents:
561
diff
changeset
|
74 MOVE_FOXES = pygame.event.Event(MOVE_FOX_ID, name="MOVE_FOXES") |
a8dde729000a
Add 'Save and Quit' option to quit dialog. Move game events from engine to constants to ease 'import engine' fun
Neil Muller <drnlmuller@gmail.com>
parents:
561
diff
changeset
|
75 DO_LOAD_SAVEGAME = USEREVENT + 2 |
a8dde729000a
Add 'Save and Quit' option to quit dialog. Move game events from engine to constants to ease 'import engine' fun
Neil Muller <drnlmuller@gmail.com>
parents:
561
diff
changeset
|
76 DO_LOAD_LEVEL = USEREVENT + 3 |
a8dde729000a
Add 'Save and Quit' option to quit dialog. Move game events from engine to constants to ease 'import engine' fun
Neil Muller <drnlmuller@gmail.com>
parents:
561
diff
changeset
|
77 DO_QUIT = pygame.event.Event(QUIT) |