-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconstants.py
47 lines (41 loc) · 1.28 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
47
##########################################################################
## constants.py
##
## All the constants, all the time.
##
## by Andrew Francis
##########################################################################
import threading
from pygame.locals import *
# Meta constants
SERVER_JID_PATTERN = '%[email protected]'
ROOM_JID_PATTERN = '%[email protected]'
LOBBY_JID = '[email protected]'
USERS_FILE = 'users.txt'
ROOMS_FILE = 'rooms.txt'
MODECHANGE = USEREVENT
CHATMESSAGE = USEREVENT+1
NETWORK = USEREVENT+2
AI = USEREVENT+3
# Screen constants
SCREEN_WIDTH = 1280
SCREEN_HEIGHT = 720
SCREEN_SIZE = SCREEN_WIDTH, SCREEN_HEIGHT
# Board constants
TILE_SIZE = 40
BOARD_SIZE = 15
BOARD_OFFSET_X = (SCREEN_WIDTH - (TILE_SIZE * BOARD_SIZE)) / 2 + TILE_SIZE/2
BOARD_OFFSET_Y = (SCREEN_HEIGHT - (TILE_SIZE * BOARD_SIZE)) / 2 + TILE_SIZE/2
# Piece constants
PIECE_TYPES = ['2','2','3','4','5','6','7','8','9','10','S','F','B']
PIECE_SIZE = 40
PIECE_START_X = BOARD_OFFSET_X - (PIECE_SIZE + PIECE_SIZE / 2)
PIECE_START_Y = BOARD_OFFSET_Y + PIECE_SIZE / 2
# Player constants
NUM_PLAYERS = 4
PLAYER_COLORS = ['red', 'blue', 'dred', 'dblue']
RED_TEAM = ['red', 'dred']
BLUE_TEAM = ['blue', 'dblue']
STOCKADE_POS = [(7,13),(1,7),(7,1),(13,7)]
# Threading
FILE_LOCK = threading.Lock()