-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcfg.py
72 lines (53 loc) · 2.05 KB
/
cfg.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/env python3
'''
A place to store global variables to customize and configure the simulation.
'''
import colors
# ******************************************************************************
# Constants for random generators
# ******************************************************************************
SEED = 42 # set the seed for random number generators for reproducability
MOVE_OPTIONS = 5 # move_0, move_up, move_down, move_left, move_right
ITERATOR = 0 # keeps track of how many steps/frames pyglet has looped over
MAX_STEPS = 1000000 # 1 million is the arbitrary limit
# ******************************************************************************
# Constants for engines (pymunk/pyglet)
# ******************************************************************************
# parameters of the window
GW = 400 # game width
GH = 400 # game height
BORDER_THICCNESS = 10
# the space within the window that food and bots can spawn
IGW = GW - (BORDER_THICCNESS) # inner game width
IGH = GH - (BORDER_THICCNESS) # inner game height
GRAVITY = (0, 0)
PY_STEP = 1.0/120 # time (seconds) since last pyglet update step
# ******************************************************************************
# Constants for debugging
# ******************************************************************************
# DEBUG can optionally be set to:
# False/0 (no-debug), 1 (asserts), 2 (prints), 3 (lots of prints)
DEBUG = True
USAGE = "usage: python3 sim.py [-d [0, 1, 2]]"
EXIT_SUCCESS = 0
EXIT_FAILURE = 1
# ******************************************************************************
# Constants for the simulation (bots, food, etc)
# ******************************************************************************
FOOD_COUNT = 100
FOOD_RADIUS = 5
FOOD_COLOR = colors.RED
# FOOD_ELASTICITY = 0.0
BOT_RADIUS = 10
BOT_COLOR = colors.YELLOW
BOT_ELASTICITY = 0.98
MOVE_STOP = 0
MOVE_UP = 1
MOVE_DOWN = 2
MOVE_RIGHT = 3
MOVE_LEFT = 4
FORWARD_VELOCITY = (0, 2000)
BACKWARD_VELOCITY = (0, -2000)
RIGHT_VELOCITY = (2000, 0)
LEFT_VELOCITY = (-2000, 0)
WALL_ELASTICITY = 0.98