annotate mamba/constants.py @ 367:35a46716ffdd

By popular demand (jeremy) backspace goes back a menu
author Stefano Rivera <stefano@rivera.za.net>
date Sat, 17 Sep 2011 00:27:19 +0200
parents d759f49c477d
children 001c3797a63b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
228
d83fd4ebddd3 Add entrybox widget
Neil Muller <drnlmuller@gmail.com>
parents: 199
diff changeset
1 from pygame.locals import K_ESCAPE, K_q, K_BACKSPACE, K_DELETE
3
6b9fa5e2fbc6 Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
2
62
40be38f4427c Bug squashing.
Simon Cross <hodgestar@gmail.com>
parents: 52
diff changeset
3 # Display constants
3
6b9fa5e2fbc6 Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
4 SCREEN = (800, 600)
62
40be38f4427c Bug squashing.
Simon Cross <hodgestar@gmail.com>
parents: 52
diff changeset
5 EDIT_SCREEN = (1000, 600)
50
1b725035b8ef Levels that are visible.
Jeremy Thurgood <firxen@gmail.com>
parents: 39
diff changeset
6 TILE_SIZE = (20, 20)
3
6b9fa5e2fbc6 Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
7
62
40be38f4427c Bug squashing.
Simon Cross <hodgestar@gmail.com>
parents: 52
diff changeset
8 # Miscellaneous constants
52
d09f63429b80 Add screen size fiddling to editor habitat
Neil Muller <drnlmuller@gmail.com>
parents: 50
diff changeset
9 NAME = "Unamed Mamba game"
122
45dd79e9ba1b Rudimentary FPS and clock ticking.
Simon Cross <hodgestar@gmail.com>
parents: 75
diff changeset
10 FPS = 60
345
04bb1ffcd054 Activated ctpug level server.
Simon Cross <hodgestar@gmail.com>
parents: 270
diff changeset
11 LEVEL_SERVER = "http://ctpug.org.za/mamba/"
52
d09f63429b80 Add screen size fiddling to editor habitat
Neil Muller <drnlmuller@gmail.com>
parents: 50
diff changeset
12
3
6b9fa5e2fbc6 Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
13 # Sound constants
6b9fa5e2fbc6 Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
14 FREQ = 44100 # same as audio CD
6b9fa5e2fbc6 Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
15 BITSIZE = -16 # unsigned 16 bit
6b9fa5e2fbc6 Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
16 CHANNELS = 2 # 1 == mono, 2 == stereo
6b9fa5e2fbc6 Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
17 BUFFER = 1024 # audio buffer size in no. of samples
17
236de980209a Add simple command line processing
Neil Muller <drnlmuller@gmail.com>
parents: 3
diff changeset
18
62
40be38f4427c Bug squashing.
Simon Cross <hodgestar@gmail.com>
parents: 52
diff changeset
19 # Keyboard constants
367
35a46716ffdd By popular demand (jeremy) backspace goes back a menu
Stefano Rivera <stefano@rivera.za.net>
parents: 366
diff changeset
20 ESCAPE_KEYS = (K_ESCAPE, K_q, K_BACKSPACE)
228
d83fd4ebddd3 Add entrybox widget
Neil Muller <drnlmuller@gmail.com>
parents: 199
diff changeset
21 DELETE_KEYS = (K_BACKSPACE, K_DELETE)
62
40be38f4427c Bug squashing.
Simon Cross <hodgestar@gmail.com>
parents: 52
diff changeset
22
75
ac6688820528 Move font name to constants, for future configurablity
Neil Muller <drnlmuller@gmail.com>
parents: 62
diff changeset
23 # For easy access later
ac6688820528 Move font name to constants, for future configurablity
Neil Muller <drnlmuller@gmail.com>
parents: 62
diff changeset
24 DEFAULT_FONT = 'DejaVuSans.ttf'
155
9afea431af36 Move common widget defauts (mainly colours) to constants
Stefano Rivera <stefano@rivera.za.net>
parents: 122
diff changeset
25 FONT_SIZE = 16
9afea431af36 Move common widget defauts (mainly colours) to constants
Stefano Rivera <stefano@rivera.za.net>
parents: 122
diff changeset
26
9afea431af36 Move common widget defauts (mainly colours) to constants
Stefano Rivera <stefano@rivera.za.net>
parents: 122
diff changeset
27 # Colours
9afea431af36 Move common widget defauts (mainly colours) to constants
Stefano Rivera <stefano@rivera.za.net>
parents: 122
diff changeset
28 FOCUS_COLOR = 'yellow'
9afea431af36 Move common widget defauts (mainly colours) to constants
Stefano Rivera <stefano@rivera.za.net>
parents: 122
diff changeset
29 COLOR = 'black'
75
ac6688820528 Move font name to constants, for future configurablity
Neil Muller <drnlmuller@gmail.com>
parents: 62
diff changeset
30
270
3c95ba7408f1 Add protected level name list. Add load & new buttons
Neil Muller <drnlmuller@gmail.com>
parents: 228
diff changeset
31 # Special level directory files
3c95ba7408f1 Add protected level name list. Add load & new buttons
Neil Muller <drnlmuller@gmail.com>
parents: 228
diff changeset
32 RESERVED_NAMES = ['index', 'blank']
3c95ba7408f1 Add protected level name list. Add load & new buttons
Neil Muller <drnlmuller@gmail.com>
parents: 228
diff changeset
33
199
986e72d2cb4d Rejiggered entrances and shifted directions around.
Jeremy Thurgood <firxen@gmail.com>
parents: 166
diff changeset
34 # Directions
986e72d2cb4d Rejiggered entrances and shifted directions around.
Jeremy Thurgood <firxen@gmail.com>
parents: 166
diff changeset
35 UP, DOWN, LEFT, RIGHT = [(0, -1), (0, 1), (-1, 0), (1, 0)]
986e72d2cb4d Rejiggered entrances and shifted directions around.
Jeremy Thurgood <firxen@gmail.com>
parents: 166
diff changeset
36
62
40be38f4427c Bug squashing.
Simon Cross <hodgestar@gmail.com>
parents: 52
diff changeset
37 # Default command-line options
17
236de980209a Add simple command line processing
Neil Muller <drnlmuller@gmail.com>
parents: 3
diff changeset
38 DEFAULTS = {
39
3ab5097e8757 Refactor options.
Simon Cross <hodgestar@gmail.com>
parents: 17
diff changeset
39 'debug': False,
17
236de980209a Add simple command line processing
Neil Muller <drnlmuller@gmail.com>
parents: 3
diff changeset
40 'sound': True,
236de980209a Add simple command line processing
Neil Muller <drnlmuller@gmail.com>
parents: 3
diff changeset
41 'level': None,
362
cc8be536a7fc Add ability to play uncurated levels via the command line.
Simon Cross <hodgestar@gmail.com>
parents: 345
diff changeset
42 'uncurated': None,
366
d759f49c477d Option for printing list of uncurated levels.
Simon Cross <hodgestar@gmail.com>
parents: 362
diff changeset
43 'list_uncurated': False,
17
236de980209a Add simple command line processing
Neil Muller <drnlmuller@gmail.com>
parents: 3
diff changeset
44 'edit': False,
166
bea4857487de Game state and level list
Stefano Rivera <stefano@rivera.za.net>
parents: 155
diff changeset
45 'save_location': None, # Determined by a function in options
17
236de980209a Add simple command line processing
Neil Muller <drnlmuller@gmail.com>
parents: 3
diff changeset
46 }