annotate mamba/constants.py @ 267:1e8dca95c48a

Hook up hot-keys in editor for jerith
author Neil Muller <drnlmuller@gmail.com>
date Thu, 15 Sep 2011 12:54:16 +0200
parents d83fd4ebddd3
children 3c95ba7408f1
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
52
d09f63429b80 Add screen size fiddling to editor habitat
Neil Muller <drnlmuller@gmail.com>
parents: 50
diff changeset
11
3
6b9fa5e2fbc6 Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
12 # Sound constants
6b9fa5e2fbc6 Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
13 FREQ = 44100 # same as audio CD
6b9fa5e2fbc6 Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
14 BITSIZE = -16 # unsigned 16 bit
6b9fa5e2fbc6 Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
15 CHANNELS = 2 # 1 == mono, 2 == stereo
6b9fa5e2fbc6 Add initial window that does very little
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
16 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
17
62
40be38f4427c Bug squashing.
Simon Cross <hodgestar@gmail.com>
parents: 52
diff changeset
18 # Keyboard constants
40be38f4427c Bug squashing.
Simon Cross <hodgestar@gmail.com>
parents: 52
diff changeset
19 ESCAPE_KEYS = (K_ESCAPE, K_q)
228
d83fd4ebddd3 Add entrybox widget
Neil Muller <drnlmuller@gmail.com>
parents: 199
diff changeset
20 DELETE_KEYS = (K_BACKSPACE, K_DELETE)
62
40be38f4427c Bug squashing.
Simon Cross <hodgestar@gmail.com>
parents: 52
diff changeset
21
75
ac6688820528 Move font name to constants, for future configurablity
Neil Muller <drnlmuller@gmail.com>
parents: 62
diff changeset
22 # For easy access later
ac6688820528 Move font name to constants, for future configurablity
Neil Muller <drnlmuller@gmail.com>
parents: 62
diff changeset
23 DEFAULT_FONT = 'DejaVuSans.ttf'
155
9afea431af36 Move common widget defauts (mainly colours) to constants
Stefano Rivera <stefano@rivera.za.net>
parents: 122
diff changeset
24 FONT_SIZE = 16
9afea431af36 Move common widget defauts (mainly colours) to constants
Stefano Rivera <stefano@rivera.za.net>
parents: 122
diff changeset
25
9afea431af36 Move common widget defauts (mainly colours) to constants
Stefano Rivera <stefano@rivera.za.net>
parents: 122
diff changeset
26 # Colours
9afea431af36 Move common widget defauts (mainly colours) to constants
Stefano Rivera <stefano@rivera.za.net>
parents: 122
diff changeset
27 FOCUS_COLOR = 'yellow'
9afea431af36 Move common widget defauts (mainly colours) to constants
Stefano Rivera <stefano@rivera.za.net>
parents: 122
diff changeset
28 COLOR = 'black'
75
ac6688820528 Move font name to constants, for future configurablity
Neil Muller <drnlmuller@gmail.com>
parents: 62
diff changeset
29
199
986e72d2cb4d Rejiggered entrances and shifted directions around.
Jeremy Thurgood <firxen@gmail.com>
parents: 166
diff changeset
30 # Directions
986e72d2cb4d Rejiggered entrances and shifted directions around.
Jeremy Thurgood <firxen@gmail.com>
parents: 166
diff changeset
31 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
32
62
40be38f4427c Bug squashing.
Simon Cross <hodgestar@gmail.com>
parents: 52
diff changeset
33 # Default command-line options
17
236de980209a Add simple command line processing
Neil Muller <drnlmuller@gmail.com>
parents: 3
diff changeset
34 DEFAULTS = {
39
3ab5097e8757 Refactor options.
Simon Cross <hodgestar@gmail.com>
parents: 17
diff changeset
35 'debug': False,
17
236de980209a Add simple command line processing
Neil Muller <drnlmuller@gmail.com>
parents: 3
diff changeset
36 'sound': True,
236de980209a Add simple command line processing
Neil Muller <drnlmuller@gmail.com>
parents: 3
diff changeset
37 'level': None,
236de980209a Add simple command line processing
Neil Muller <drnlmuller@gmail.com>
parents: 3
diff changeset
38 'edit': False,
166
bea4857487de Game state and level list
Stefano Rivera <stefano@rivera.za.net>
parents: 155
diff changeset
39 '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
40 }