-
Notifications
You must be signed in to change notification settings - Fork 2
/
constants.py
46 lines (39 loc) · 1.34 KB
/
constants.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env python3
# Created by: Cameron and RJ
# Created on: October 2019
# This constants file is CircuitPython Stage game
# CircuitPython screen size is 160x128 and sprites are 16x16
SCREEN_X = 160
SCREEN_Y = 128
SCREEN_GRID_X = 16
SCREEN_GRID_Y = 8
SPRITE_SIZE = 16
OFF_TOP_SCREEN = -1 * SPRITE_SIZE
OFF_BOTTOM_SCREEN = SCREEN_Y + SPRITE_SIZE
STAR_NUMBER = 20
BLINK_TIMES = 1
OFF_RIGHT_SCREEN = SCREEN_X + SPRITE_SIZE
OFF_LEFT_SCREEN = -1 - SPRITE_SIZE
OFF_BOTTOM_SCREEN = SCREEN_Y + SPRITE_SIZE
TOTAL_NUMBER_OF_ROCKS = 2
OFF_SCREEN_X = -100
OFF_SCREEN_Y = -100
SNAKE_CREATION_TOTAL = 2
TOTAL_NUMBER_OF_SNAKES = 1
SNAKE_SPEED = 2.5
SNAKOB_SPEED = 2
ROCK_SPEED = 3.5
MT_GAME_STUDIO_PALETTE = (b'\xf8\x1f\x00\x00\xcey\x00\xff\xf8\x1f\xff\x19\xfc\xe0\xfd\xe0'
b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff')
CUSTOM_PALETTE = (b'\xf8\x1f\x00\x00\xcey\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff'
b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff')
BLANK_PALETTE = (b'')
SCORE_PALETTE = (b'\xf8\x1f\x00\x00\xcey\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff'
b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff')
# Using for button state
button_state = {
"button_up": "up",
"button_just_pressed": "just pressed",
"button_still_pressed": "still pressed",
"button_released": "released",
}