-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
30 lines (24 loc) · 792 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
import pygame, sys
from scripts import editor
pygame.init()
class Program:
def __init__(self):
self.screen = pygame.display.set_mode((1100, 600))
pygame.mouse.set_visible(False)
self.editor = editor.Editor(self.screen.get_size())
self.clock = pygame.time.Clock()
def start(self):
self.update()
def update(self):
while True:
#events
self.editor.pre_event_handler()
for i in pygame.event.get():
self.editor.event_handler(i)
if i.type == pygame.QUIT:
pygame.quit()
sys.exit()
dt = self.clock.tick() * 0.001
self.editor.update(self.screen, dt)
pygame.display.update()
Program().start()