pocket-friends/pocket_friends/surfaces/title.py

25 lines
672 B
Python
Raw Normal View History

2023-05-11 09:58:44 -04:00
import pygame
from pocket_friends.elements import surface
2023-05-11 09:58:44 -04:00
class Surface(surface.GameSurface):
def __init__(self, game_res, resources_dir, game_fps):
super().__init__(game_res, resources_dir, game_fps)
2023-05-11 09:58:44 -04:00
self.frames = 0
self.delay = 1
2023-05-11 12:20:07 -04:00
self.title = pygame.image.load(resources_dir + '/images/title.png').convert_alpha()
2023-05-11 09:58:44 -04:00
def update(self):
"""
Advance the surface logic by one frame.
"""
self.preprocess()
2023-05-11 12:20:07 -04:00
self.blit(self.title, (0, 0))
2023-05-11 09:58:44 -04:00
self.frames += 1
if self.frames > self.game_fps * self.delay:
self.next_surface = 'egg_select'
self.running = False