-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
31 lines (23 loc) · 663 Bytes
/
main.py
File metadata and controls
31 lines (23 loc) · 663 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
import sys
import pygame
from lib.screen import Screen
def main():
pygame.init()
clock = pygame.time.Clock()
screen_width = 800
screen_height = 800
screen = pygame.display.set_mode((screen_width, screen_height))
game = Screen(screen_width, screen_height)
while True:
dt = clock.tick(60) / 1000
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
game.process_event(event)
screen.fill("white")
game.draw(screen)
game.update(dt)
pygame.display.flip()
if __name__ == "__main__":
main()