-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
38 lines (27 loc) · 791 Bytes
/
main.py
File metadata and controls
38 lines (27 loc) · 791 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
import pygame
import sys
from logic import settings
from classes.game import Game
def main():
pygame.init()
screen = pygame.display.set_mode((settings.WIDTH, settings.HEIGHT))
pygame.display.set_caption("Spiral Marble Shooter")
clock = pygame.time.Clock()
game = Game(screen)
game.state = "menu"
running = True
while running:
dt = clock.tick(settings.FPS) / 1000.0
events = pygame.event.get()
for event in events:
if event.type == pygame.QUIT:
running = False
dt = clock.tick(settings.FPS) / 1000.0
game.handle_events(events)
game.update(dt)
game.draw(screen)
pygame.display.flip()
pygame.quit()
sys.exit()
if __name__ == "__main__":
main()