wip, might not be good
This commit is contained in:
parent
f53879f961
commit
6d5bfaeeda
63 changed files with 1897 additions and 93 deletions
25
learn_sql_model/game/debug.py
Normal file
25
learn_sql_model/game/debug.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import pygame
|
||||
|
||||
|
||||
class Debug:
|
||||
def __init__(self, game):
|
||||
self.game = game
|
||||
self.is_open = False
|
||||
self.debounce = False
|
||||
|
||||
def handle_events(self, events):
|
||||
for event in events:
|
||||
if event.type == pygame.KEYDOWN:
|
||||
if event.key == pygame.K_F3 and not self.debounce:
|
||||
self.is_open = not self.is_open
|
||||
self.debounce = True
|
||||
if event.type == pygame.KEYUP:
|
||||
if event.key == pygame.K_F3:
|
||||
self.debounce = False
|
||||
|
||||
def render(self):
|
||||
if self.is_open:
|
||||
text = self.game.font.render(
|
||||
str(int(self.game.clock.get_fps())) + " fps", True, (255, 255, 255)
|
||||
)
|
||||
self.game.screen.blit(text, (20, 20))
|
||||
Loading…
Add table
Add a link
Reference in a new issue