-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.py
61 lines (48 loc) · 1.41 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
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
from csv import reader
from os import walk
import pygame
#ustawienia Wyswietlania:
WIDTH = 1280
HEIGHT = 720
MODE_TYPES = [pygame.FULLSCREEN, pygame.NOFRAME, pygame.SHOWN] #sposob wyswietlania
TILESIZE = 16
SCALE = 3
FPS = 60
#menu
MENU_FONT_SIZE= "Green"
MENU_BACKGROUND = "Black"
#UI
BAR_HEIGHT = 20
BAR_WIDTH = 200
ITEM_SIZE = 80
UI_FONT_SIZE = 18
UI_FONT = 'Comic Sans MS'
END_BACKGROUND = (0, 0, 255)
UI_BG_COLOR = (0, 0, 0)
UI_BORDER_COLOR = (255, 255, 255)
TEXT_COLOR = (255, 255, 255)
HEALTH_BAR_COLOR = (255, 0, 0)
ENERGY_COLOR = (0, 255, 0)
UI_BORDER_COLOR_ACTIVE = 'gold'
magic_data = {
'fireball': {'strength': 10, 'speed': 10, 'cost': 10, 'cooldown': 500,'graphic': '../Grafika/fireball.png'},
'lightning': {'strength': 20, 'speed': 20, 'cost': 20, 'cooldown': 1000, 'graphic': 'yellow'}
}
monster_data = {
'slime' : {'health': 30, 'speed': 7, 'strength': 10, 'graphic': '../Grafika/Enemies/2.png', 'notice_radius': 400},
}
def import_csv_layout(path):
terrain_map = []
with open(path) as level_map:
layout = reader(level_map,delimiter = ',')
for row in layout:
terrain_map.append(list(row))
return terrain_map
def import_folder(path):
surface_list = []
for _,__,img_files in walk(path):
for image in img_files:
full_path = path + '/' + image
image_surf = pygame.transform.scale_by(pygame.image.load(full_path).convert_alpha(),SCALE)
surface_list.append(image_surf)
return surface_list