-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpseudocode.txt
More file actions
47 lines (36 loc) · 1.33 KB
/
pseudocode.txt
File metadata and controls
47 lines (36 loc) · 1.33 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
current_level = int
active_bullets, inactive_bullets = list, list
active_boss_parts= list
destroy_shooter, level_advance = false, false
game_engine {
while true {
if destroy_shooter:
shooter.destroy() //explosion animation?
break
if level_advance:
current_level++
load_boss(current_level, active_boss_parts)
shooter.update_position()
boss.update_position()
for part in active_boss_parts:
if collision(shooter.cone, part.hitbox):
part.hitpoints--
if part.hitpoints == 0:
active_boss_parts.remove(part)
part.destroy() //explosion, update evolution, destroy attached parts
if len(active_boss_parts) == 0:
level_advance = true
continue
for bullet in active_bullets:
bullet.update_position()
if collision(bullet, shooter.hitbox):
inactive_bullets.add(bullet)
active_bullets.remove(bullet)
shooter.hitpoints--
if shooter.hitpoints == 0:
destroy_shooter = true
continue
redraw()
}
goto_game_over()
}