-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlevels.py
More file actions
147 lines (138 loc) · 3.51 KB
/
levels.py
File metadata and controls
147 lines (138 loc) · 3.51 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
from dataclasses import dataclass
from pathlib import Path
from paths import assetsPath, screensPath
# You can easily add new levels here, the level system was designed so we can add levels pretty quickly
# Please, don't touch this
@dataclass(frozen=True)
class LevelConfig:
levelId: int
name: str
gravity: float
jumpForce: float
bDoubleJump: bool
doubleJumpForce: float
bSlideEnabled: bool
coyoteTime: float
jumpBuffer: float
scrollSpeed: float
bSpeedGrowth: bool
speedGrowth: float
maxSpeed: float
obstacleMinDelay: float
obstacleMaxDelay: float
bFallingCages: bool
finaleScore: int
laneDodgeScore: int
maxHits: int
slowdownDuration: float
slowdownMult: float
obstacleDir: Path
backgroundPath: Path
chaserFramesPath: Path
bHasCeilingTiles: bool
bHasGroundTiles: bool
bLaserEnabled: bool
laserCooldown: float
laserRange: float
bHasChaser: bool
bGeometricObstacles: bool
level1Config = LevelConfig(
levelId=1,
name="NIVEAU 1",
gravity=1100.0,
jumpForce=-650.0,
bDoubleJump=False,
doubleJumpForce=0.0,
bSlideEnabled=True,
coyoteTime=0.0,
jumpBuffer=0.0,
scrollSpeed=400.0,
bSpeedGrowth=False,
speedGrowth=0.0,
maxSpeed=400.0,
obstacleMinDelay=2.5,
obstacleMaxDelay=5.0,
bFallingCages=True,
finaleScore=1000,
laneDodgeScore=100,
maxHits=3,
slowdownDuration=0.8,
slowdownMult=0.4,
obstacleDir=assetsPath / "lanes",
backgroundPath=screensPath / "background.png",
chaserFramesPath=assetsPath / "chaser" / "running" / "frames",
bHasCeilingTiles=True,
bHasGroundTiles=True,
bLaserEnabled=False,
laserCooldown=0.0,
laserRange=0.0,
bHasChaser=True,
bGeometricObstacles=False,
)
level2Config = LevelConfig(
levelId=2,
name="NIVEAU 2",
gravity=2200.0,
jumpForce=-860.0,
bDoubleJump=True,
doubleJumpForce=-780.0,
bSlideEnabled=False,
coyoteTime=0.09,
jumpBuffer=0.11,
scrollSpeed=420.0,
bSpeedGrowth=True,
speedGrowth=6.0,
maxSpeed=900.0,
obstacleMinDelay=0.7,
obstacleMaxDelay=1.7,
bFallingCages=False,
finaleScore=2000,
laneDodgeScore=100,
maxHits=3,
slowdownDuration=1.15,
slowdownMult=0.68,
obstacleDir=assetsPath / "lanes",
backgroundPath=assetsPath / "level2" / "background.png",
chaserFramesPath=assetsPath / "chaser" / "running" / "frames",
bHasCeilingTiles=False,
bHasGroundTiles=True,
bLaserEnabled=False,
laserCooldown=0.0,
laserRange=0.0,
bHasChaser=True,
bGeometricObstacles=False,
)
level3Config = LevelConfig(
levelId=3,
name="NIVEAU 3",
gravity=1800.0,
jumpForce=-700.0,
bDoubleJump=False,
doubleJumpForce=0.0,
bSlideEnabled=True,
coyoteTime=0.08,
jumpBuffer=0.1,
scrollSpeed=720.0,
bSpeedGrowth=False,
speedGrowth=0.0,
maxSpeed=720.0,
obstacleMinDelay=0.5,
obstacleMaxDelay=1.3,
bFallingCages=False,
finaleScore=3000,
laneDodgeScore=50,
maxHits=3,
slowdownDuration=0.8,
slowdownMult=0.4,
obstacleDir=assetsPath / "geometric",
backgroundPath=assetsPath / "level3" / "background.png",
chaserFramesPath=assetsPath / "chaser" / "running" / "frames",
bHasCeilingTiles=False,
bHasGroundTiles=True,
bLaserEnabled=True,
laserCooldown=0.2,
laserRange=800.0,
bHasChaser=False,
bGeometricObstacles=True,
)
levelConfigs: dict[int, LevelConfig] = {1: level1Config, 2: level2Config, 3: level3Config}