2026-05-21 15:07:53 -05:00
|
|
|
"""Entrypoint for asteroids game"""
|
|
|
|
|
|
|
|
|
|
import pygame
|
|
|
|
|
|
2026-05-21 15:10:25 -05:00
|
|
|
from constants import SCREEN_HEIGHT, SCREEN_WIDTH
|
2026-05-21 15:29:17 -05:00
|
|
|
from logger import log_state
|
2026-05-21 15:10:25 -05:00
|
|
|
|
2026-05-21 15:07:53 -05:00
|
|
|
def main():
|
|
|
|
|
"""Main method for asteroids game"""
|
|
|
|
|
print(f"Starting Asteroids with pygame version: {pygame.version.ver}")
|
2026-05-21 15:10:25 -05:00
|
|
|
print(f"Screen width: {SCREEN_WIDTH}")
|
|
|
|
|
print(f"Screen height: {SCREEN_HEIGHT}")
|
2026-05-21 15:29:17 -05:00
|
|
|
pygame.init()
|
|
|
|
|
screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
|
|
|
|
|
|
|
|
|
|
while True:
|
|
|
|
|
log_state()
|
|
|
|
|
|
|
|
|
|
for event in pygame.event.get():
|
|
|
|
|
if event.type == pygame.QUIT:
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
screen.fill("black")
|
|
|
|
|
pygame.display.flip()
|
2026-05-21 15:07:53 -05:00
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
|
main()
|