-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPygameTemplate.py
More file actions
34 lines (26 loc) · 842 Bytes
/
Copy pathPygameTemplate.py
File metadata and controls
34 lines (26 loc) · 842 Bytes
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
"""Alexsander Rosante's creation"""
import pygame
from pygame.locals import *
pygame.init()
class Game:
def __init__(self):
self.display = pygame.display.set_mode((display_w, display_h))
self.clock, self.fps = pygame.time.Clock(), 60
self.events = pygame.event.get()
self.loop = True
def check_events(self):
self.events = pygame.event.get()
for event in self.events:
if event.type == QUIT:
self.loop = False
def run(self):
while self.loop:
self.check_events()
self.display.fill('black')
pygame.display.update()
self.clock.tick(self.fps)
pygame.quit()
if __name__ == '__main__':
display_w, display_h = 1152, 648
game = Game()
game.run()