-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain_base.py
45 lines (33 loc) · 871 Bytes
/
main_base.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
41
42
43
44
45
import pygame
from pygame.locals import *
pygame.init()
GAME_RES = WIDTH, HEIGHT = 800, 600
FPS = 60
GAME_TITLE = 'Default Game Title'
window = pygame.display.set_mode(GAME_RES, HWACCEL|HWSURFACE|DOUBLEBUF)
pygame.display.set_caption(GAME_TITLE)
clock = pygame.time.Clock()
# Game Values
background_color = (150, 150, 150) # RGB value
count = 1
# End of Game Values
# Game loop
game_ended = False
while not game_ended:
# Event handling
for event in pygame.event.get():
if event.type == QUIT:
game_ended = True
break
if event.type == KEYDOWN:
if event.key == K_ESCAPE:
game_ended = True
break
# Game logic
count += 1
# Display update
pygame.Surface.fill(window, background_color)
pygame.display.update()
clock.tick(FPS)
pygame.quit()
exit(0)