-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTheTrolleyProblemGame.py
More file actions
executable file
·40 lines (27 loc) · 923 Bytes
/
TheTrolleyProblemGame.py
File metadata and controls
executable file
·40 lines (27 loc) · 923 Bytes
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
#!/usr/bin/env pipenv-shebang
from profilehooks import profile
from scenes import StartScene
import pygame
import subprocess
@profile
def main():
# Call this function so the Pygame library can initialize itself
pygame.init()
# Set the title of the window
pygame.display.set_caption("The Trolley Problem Game")
active_scene = StartScene.StartScene(pygame.display.set_mode((1700, 800)))
while active_scene is not None:
# process inputs
pressed_keys = pygame.key.get_pressed()
active_scene.process_input(events=pygame.event.get(), pressed_keys=pressed_keys)
# updates
active_scene.update()
# render
active_scene.render()
pygame.display.flip()
# Pause
active_scene.clock.tick(active_scene.sim_to_real.params.fps)
active_scene = active_scene.next
pygame.quit()
if __name__ == "__main__":
main()