init, still not decided between pygame and blessed
This commit is contained in:
36
main.py
Normal file
36
main.py
Normal 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()
|
||||
Reference in New Issue
Block a user