forked from antarcticalgebra/antarcticalgebra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.py
executable file
·35 lines (27 loc) · 908 Bytes
/
run.py
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
32
33
34
35
#! /usr/bin/env python2
import pygame
from menu import Menu
from game import game
def main():
pygame.init()
size = (800,600)
pygame.display.set_caption("Antarctic Algebra Proof of Concept")
pygame.mouse.set_visible(False)
screen = pygame.display.set_mode(size)
clock = pygame.time.Clock()
state = 0
states = [Menu(screen).draw, game(screen).draw]
running = True
while running:
milliseconds = clock.tick(60) # maximum number of frames per second
event = pygame.event.poll()
if event.type == pygame.QUIT:
running = False
elif event.type == pygame.KEYDOWN:
if event.key == pygame.K_ESCAPE:
running = False
pygame.display.flip()
state = states[state](event) # sets the state of the game.
pygame.quit()
if __name__ == "__main__":
main()