Files
bootdev_asteroids/main.py

34 lines
698 B
Python
Raw Normal View History

2025-07-04 15:54:54 +02:00
import pygame
import sys
from constants import *
def main():
print("Starting Asteroids!")
print(f"Screen width: {SCREEN_WIDTH}")
print(f"Screen height: {SCREEN_HEIGHT}")
pygame.init()
if pygame.get_init() == False:
pygame.quit()
sys.exit(1)
screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
2025-07-04 16:00:36 +02:00
time = pygame.time.Clock()
dt = 0
2025-07-04 15:54:54 +02:00
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
return
pygame.Surface.fill(screen, (0,0,0))
2025-07-04 16:00:36 +02:00
pygame.display.flip() #refresh screen
2025-07-04 15:54:54 +02:00
2025-07-04 16:00:36 +02:00
dt = time.tick(60) / 1000 #conveted to ms
2025-07-04 15:54:54 +02:00
if __name__ == "__main__":
main()