44 lines
955 B
Python
44 lines
955 B
Python
#!/usr/bin/python3
|
|
|
|
import pygame
|
|
from wobbl_tools import pg
|
|
from sprite_stacking_engine.engine import Engine
|
|
|
|
|
|
class Moss:
|
|
def __init__(self):
|
|
self.screen = pygame.display.set_mode((1400, 800))
|
|
self.clock = pygame.time.Clock()
|
|
self.engine = Engine(self)
|
|
self.time = 0
|
|
self.delta_time = 0.01
|
|
|
|
self.running = True
|
|
|
|
def update(self):
|
|
pygame.display.set_caption(f"{self.clock.get_fps(): .1f}")
|
|
self.delta_time = self.clock.tick(60)
|
|
self.engine.update()
|
|
|
|
def draw(self):
|
|
self.engine.draw()
|
|
|
|
self.screen.blit(self.engine.surface, (0, 0))
|
|
|
|
pygame.display.flip()
|
|
|
|
def get_time(self):
|
|
self.time = pygame.time.get_ticks() * 0.001
|
|
|
|
def tick(self):
|
|
self.engine.check_events()
|
|
self.get_time()
|
|
self.update()
|
|
self.draw()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
game = Moss()
|
|
|
|
while game.running:
|
|
game.tick()
|