forked from harikrishnan-git/pygame-tinkerhub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.py
36 lines (27 loc) · 1 KB
/
settings.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
import pygame as pg
vec = pg.math.Vector2
FPS = 60
FIELD_COLOR = (16, 20, 12)
BG_COLOR = (15, 19, 11)
MUSIC = ["song1.mp3, song2.mp3"]
SPRITE_DIR_PATH = 'assets/sprites'
FONT_PATH = 'assets/font/Freshman.ttf'
ANIM_TIME_INTERVAL = 250 # milliseconds
FAST_ANIM_TIME_INTERVAL = 50
TILE_SIZE = 48
FIELD_SIZE = FIELD_W, FIELD_H = 10, 20
FIELD_RES = FIELD_W * TILE_SIZE, FIELD_H * TILE_SIZE
FIELD_SCALE_W, FIELD_SCALE_H = 1.7, 1.0
WIN_RES = WIN_W, WIN_H = FIELD_RES[0] * FIELD_SCALE_W, FIELD_RES[1] * FIELD_SCALE_H
INIT_POS_OFFSET = vec(FIELD_W // 2 - 1, 0)
NEXT_POS_OFFSET = vec(FIELD_W * 1.3, FIELD_H * 0.45)
MOVE_DIRECTIONS = {'left': vec(-1, 0), 'right': vec(1, 0), 'down': vec(0, 1)}
TETROMINOES = {
'T': [(0, 0), (-1, 0), (1, 0), (0, -1)],
'O': [(0, 0), (0, -1), (1, 0), (1, -1)],
'J': [(0, 0), (-1, 0), (0, -1), (0, -2)],
'L': [(0, 0), (1, 0), (0, -1), (0, -2)],
'I': [(0, 0), (0, 1), (0, -1), (0, -2)],
'S': [(0, 0), (-1, 0), (0, -1), (1, -1)],
'Z': [(0, 0), (1, 0), (0, -1), (-1, -1)]
}