-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.py
More file actions
119 lines (99 loc) · 4.27 KB
/
settings.py
File metadata and controls
119 lines (99 loc) · 4.27 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
"""
This module was autogenerated by gale.
"""
#from pathlib import Path
import pathlib
import pygame
from gale import frames
from gale import input_handler
from src import level_loader
input_handler.InputHandler.set_keyboard_action(input_handler.KEY_RETURN, 'enter')
input_handler.InputHandler.set_keyboard_action(input_handler.KEY_ESCAPE, 'quit')
input_handler.InputHandler.set_keyboard_action(input_handler.KEY_LEFT, 'move_left')
input_handler.InputHandler.set_keyboard_action(input_handler.KEY_RIGHT, 'move_right')
input_handler.InputHandler.set_keyboard_action(input_handler.KEY_UP, 'move_up')
input_handler.InputHandler.set_keyboard_action(input_handler.KEY_DOWN, 'move_down')
input_handler.InputHandler.set_keyboard_action(input_handler.KEY_SPACE, 'jump')
input_handler.InputHandler.set_mouse_click_action(input_handler.MOUSE_BUTTON_1, 'attack')
#for testing
input_handler.InputHandler.set_keyboard_action(input_handler.KEY_r, 'reset')
input_handler.InputHandler.set_keyboard_action(input_handler.KEY_c, 'change')
# Size we want to emulate
VIRTUAL_WIDTH = 640
VIRTUAL_HEIGHT = 480
# Size of our actual window
WINDOW_WIDTH = 1024
WINDOW_HEIGHT = 720
BASE_DIR = pathlib.Path(__file__).parent
PLAYER_SPEED = 80
ENEMY_SPEED = 20
GRAVITY = 980
# Register your textures from the graphics folder, for instance:
# TEXTURES = {
# 'my_texture': pygame.image.load(BASE_DIR / "assets" / "graphics" / "my_texture.png")
# }
#
# TEXTURES = {
# "background": pygame.image.load(BASE_DIR / "graphics" / "background.png"),
# "spritesheet": pygame.image.load(BASE_DIR / "graphics" / "breakout.png"),
# "hearts": pygame.image.load(BASE_DIR / "graphics" / "hearts.png"),
# "arrows": pygame.image.load(BASE_DIR / "graphics" / "arrows.png"),
# }
TEXTURES = {
"background": pygame.image.load(BASE_DIR / "assets" / "graphics" / "background.jpg"),
"player_sprites_sheets": pygame.image.load(BASE_DIR / "assets" / "graphics" / "male_sprites.png"),
"icon_game": pygame.image.load(BASE_DIR / "assets" / "graphics" /"Icon.png"),
"enemy_sprites_sheets": pygame.image.load(BASE_DIR / "assets" / "graphics" / "enemy_sprites.png"),
"tiles": pygame.image.load(BASE_DIR / "assets" / "graphics" / "forest_sheet.png"),
"fokito": pygame.image.load(BASE_DIR / "assets" / "graphics" / "fokito-16-26.png"),
"skeleton": pygame.image.load(BASE_DIR / "assets" / "graphics" / "skeleton.png"),
"martian": pygame.image.load(BASE_DIR / "assets" / "graphics" / "martian.png"),
}
# Register your frames, for instance:
# FRAMES = {
# 'my_frames': frames.generate_frames(TEXTURES['my_texture'], 16, 16)
# }
#
# FRAMES = {
# "paddles": generate_paddle_frames(),
# "balls": generate_ball_frames(),
# "bricks": generate_brick_frames(TEXTURES["spritesheet"]),
# "hearts": generate_frames(TEXTURES["hearts"], 10, 9),
# "arrows": generate_frames(TEXTURES["arrows"], 24, 24),
# }
FRAMES = {
"tiles": frames.generate_frames(TEXTURES["tiles"], 18, 18),
"fokito": frames.generate_frames(TEXTURES["fokito"], 16, 26),
"skeleton": frames.generate_frames(TEXTURES["skeleton"], 30, 47),
"martian": frames.generate_frames(TEXTURES["martian"], 16, 20),
}
pygame.mixer.init()
# Register your sound from the sounds folder, for instance:
# SOUNDS = {
# 'my_sound': pygame.mixer.Sound(BASE_DIR / "assets" / "sounds" / "my_sound.wav"),
# }
#
# SOUNDS = {
# "paddle_hit": pygame.mixer.Sound(BASE_DIR / "sounds" / "paddle_hit.wav"),
# "selected": pygame.mixer.Sound(BASE_DIR / "sounds" / "selected.wav"),
# }
SOUNDS = {}
pygame.font.init()
# Register your fonts from the fonts folder, for instance:
# FONTS = {
# 'small': pygame.font.Font(BASE_DIR / "assets" / "fonts" / "font.ttf", 8)
# }
FONTS = {
"score_tiny": pygame.font.Font(BASE_DIR / "assets" / "fonts" / "font.ttf", 8),
"tiny": pygame.font.Font(BASE_DIR / "assets" / "fonts" / "fireside.otf", 12),
"small": pygame.font.Font(BASE_DIR / "assets" / "fonts" / "fireside.otf", 18),
"medium": pygame.font.Font(BASE_DIR / "assets" / "fonts" / "fireside.otf", 24),
"large": pygame.font.Font(BASE_DIR / "assets" / "fonts" / "fireside.otf", 32),
}
#implement with drawableMixin
NUM_LEVELS = 2
LevelLoader = level_loader.TmxSceneLoader
TILEMAPS = {
i: BASE_DIR / "assets" / "tilemaps" / f"level{i}" for i in range(1, NUM_LEVELS + 1)
}
#END