pocket-friends/pocket_friends/surfaces/title.py

26 lines
699 B
Python

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