init, still not decided between pygame and blessed

This commit is contained in:
2025-07-25 22:31:35 +02:00
commit a263d6dafb
10 changed files with 172 additions and 0 deletions

36
main.py Normal file
View File

@@ -0,0 +1,36 @@
import pygame
import sys
from constants import *
def main():
print("Starting BattleShip!")
pygame.init()
if pygame.get_init() == False:
pygame.quit()
sys.exit(1)
screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
time = pygame.time.Clock()
dt = 0
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
print("Quitting Battleships")
return
pygame.Surface.fill(screen, (0,0,0))
pygame.display.flip() #refresh screen
dt = time.tick(60) / 1000 #converted to ms
if __name__ == "__main__":
main()