marked error_screen as a protected module, added --dev launch option
This commit is contained in:
28
pocket_friends/_development/surfaces/_error_screen.py
Normal file
28
pocket_friends/_development/surfaces/_error_screen.py
Normal file
@@ -0,0 +1,28 @@
|
||||
import pygame
|
||||
from pocket_friends.elements import surface
|
||||
|
||||
|
||||
class Surface(surface.GameSurface):
|
||||
def __init__(self, game_res, resources_dir, game_fps, **kwargs):
|
||||
super().__init__(game_res, resources_dir, game_fps)
|
||||
self.frames = 1
|
||||
self.game_fps = game_fps
|
||||
self.delay = 1
|
||||
self.font = pygame.font.Font(resources_dir + '/fonts/5Pts5.ttf', 10)
|
||||
self.title = pygame.image.load(resources_dir + '/images/debug/invalid.png').convert_alpha()
|
||||
self.next_surface = 'title'
|
||||
|
||||
def update(self):
|
||||
self.preprocess()
|
||||
|
||||
self.blit(self.title, (0, -4))
|
||||
text = self.font.render('Frames: {0}'.format(self.frames), False, (64, 64, 64))
|
||||
self.blit(text, (3, 68))
|
||||
|
||||
self.frames += 1
|
||||
self.frames %= self.game_fps
|
||||
|
||||
for event in pygame.event.get():
|
||||
if event.type == pygame.KEYDOWN:
|
||||
if event.key == pygame.K_b:
|
||||
self.running = False
|
Reference in New Issue
Block a user