-
Notifications
You must be signed in to change notification settings - Fork 1
/
Settings.py
98 lines (81 loc) · 3.51 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
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
import pygame
import os
from screeninfo import get_monitors
class Score:
def __init__(self):
self.score = 0
def add_score(self):
self.score += 10
def get_score(self):
return self.score
class GlobalConstants:
# --------------------PATHS----------------------------------------------------
B_A_PATH = os.path.join("Pictures", "Player", "BasicAirplane")
T_I_PATH = os.path.join("Pictures", "TitleIcon", "title_icon.png")
BULL_PATH = os.path.join("Pictures", "Bullets", "Fireball")
R_BULL_PATH = os.path.join("Pictures", "Bullets", "Red_fireball")
B_Bull_PATH = os.path.join("Pictures", "Bullets", "Bomb")
BACK_PATH = os.path.join("Pictures", "Background")
B_E_PATH = os.path.join("Pictures", "Enemy", "BasicEnemy")
R_PATH = os.path.join("Pictures", "Enemy", "Rocket")
BOM_PATH = os.path.join("Pictures", "Enemy", "Bomber")
EXPLO_PATH = os.path.join("Pictures", "Explosion")
PIX_FONT_PATH = os.path.join("Fonts", "Pixel_font.ttf")
HEART_PATH = os.path.join("Pictures", "Heart")
HOUSE_PATH = os.path.join("Pictures", "House")
HOUSE_PIC_PATH = [os.path.join(HOUSE_PATH, "house.png")]
B_BULL_PIC_PATHS = [os.path.join(B_Bull_PATH, "bomb.png")]
HEART_PIC_PATH = [os.path.join(HEART_PATH, "heart.png")]
R_BULL_PIC_PATHS = [os.path.join(R_BULL_PATH, "red_fireball.png")]
BOM_PIC_PATH = [os.path.join(BOM_PATH, "bomber.png")]
Fire_PIC_PATHS = [os.path.join(BULL_PATH, "bullet.png")]
ROC_PIC_PATH = [os.path.join(R_PATH, "rocket.png")]
BACK_PIC_PATHS = [os.path.join(BACK_PATH, "background.png")]
ENEMY_PIC_PATHS = [os.path.join(B_E_PATH, "straight.png")]
PLAYER_PIC_PATHS = (lambda x=B_A_PATH: [os.path.join(x, p + ".png") for p in ["straight", "left", "right"]])()
# --------------------OTHER VARIABLES-------------------------------------------
SCREEN_WIDTH = int(get_monitors()[-1].height / 1.8)
SCREEN_LENGTH = int(get_monitors()[-1].height / 1.2)
MARGIN = int(SCREEN_WIDTH / 20.69)
FONT_SIZE = int(SCREEN_WIDTH / 11)
GAP_BETWEEN_H_H = SCREEN_WIDTH / 30000
MIN_DISTANCE = int(SCREEN_WIDTH / 52)
SPITFIRE_WIDTH = int(SCREEN_WIDTH / 5)
SPITFIRE_HEIGHT = int(SCREEN_WIDTH / 5.71)
MESSERSCHMITT_WIDTH = int(SCREEN_WIDTH / 5.26)
MESSERSCHMITT_HEIGHT = int(SCREEN_WIDTH / 5.71)
BOMBER_WIDTH = int(SCREEN_WIDTH / 3.27)
BOMBER_HEIGHT = int(SCREEN_WIDTH / 4.16)
HEART_WIDTH = int(SCREEN_WIDTH / 12.27)
HEART_HEIGHT = int(SCREEN_WIDTH / 13.5)
HOUSE_WIDTH = int(SCREEN_WIDTH / 13.5)
HOUSE_HEIGHT = int(SCREEN_WIDTH / 13.5)
ROCKET_WIDTH = int(SCREEN_WIDTH / 13.85)
ROCKET_HEIGHT = int(SCREEN_WIDTH / 6)
SCREEN = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_LENGTH))
ENEMIES = []
BULLETS = []
EXPLOSIONS = []
LIVES = []
HOUSES = []
BULLET_WIDTH = int(SCREEN_WIDTH / 180)
BULLET_HEIGHT = int(SCREEN_WIDTH / 60)
BOMB_WIDTH = int(SCREEN_WIDTH / 54)
BOMB_HEIGHT = int(SCREEN_WIDTH / 20)
BOMB_SPEED = SCREEN_WIDTH / 90
MESSERSCHMITT_SPEED = SCREEN_WIDTH / 150
BULLET_SPEED = SCREEN_WIDTH / 80
BOMBER_SPEED = SCREEN_WIDTH / 150
ROCKET_SPEED = SCREEN_WIDTH / 70
class PlayerConstants(GlobalConstants):
def __init__(self):
self.SPEED = self.SCREEN_WIDTH / 120
class BackgroundConstants(GlobalConstants):
def __init__(self):
self.BG_SPEED = self.SCREEN_WIDTH / 270
class LevelsConstants(GlobalConstants):
def __init__(self):
pass
class MaskConstants(GlobalConstants):
def __init__(self):
pass