forked from NoPriorCut/comp150-game
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.py
40 lines (33 loc) · 961 Bytes
/
Main.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
36
37
38
39
40
import pygame, sys, LoadImages, Inputs
from pygame.locals import *
pygame.init()
# variables
refreshRate = 60
resolution = (750, 1334)
# colours
darkBrown = (79, 51, 44)
lightBrown = (107, 74, 55)
darkYellow = (124, 91, 51)
lightYellow = (147, 117, 53)
black = (0, 0, 0)
darkGrey = (63, 63, 63)
midGrey = (127, 127, 127)
lightGrey = (191, 191, 191)
# guff
displaySurface = pygame.display.set_mode(resolution)
clock = pygame.time.Clock()
pygame.display.set_caption('Sekai Saviour')
displaySurface.fill(darkBrown)
# game loop
while True:
for event in pygame.event.get():
if event.type == QUIT or (event.type == KEYUP and event.key == K_ESCAPE):
pygame.quit()
sys.exit()
elif event.type == MOUSEBUTTONDOWN: # start to read input
mouseX, mouseY = event.pos
Inputs.read_mouse_movements(mouseX, mouseY)
# redraw display
pygame.display.flip()
# cap fps
clock.tick(refreshRate)