title screen moves on now to sprite selection
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
import os
|
||||
__all__ = []
|
||||
for module in os.listdir(os.path.dirname(os.path.abspath(__file__))):
|
||||
if module != '__init__.py' and module[-3:] == '.py':
|
||||
__all__.append(module)
|
||||
|
||||
|
17
pocket_friends/game_files/surfaces/egg_select.py
Normal file
17
pocket_friends/game_files/surfaces/egg_select.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import pygame
|
||||
|
||||
|
||||
class Surface(pygame.Surface):
|
||||
def __init__(self, window_size, resources_dir, game_fps):
|
||||
super().__init__(window_size, pygame.SRCALPHA)
|
||||
self.name = 'egg_select'
|
||||
self.running = True
|
||||
self.next_surface = None
|
||||
|
||||
self.bg = pygame.image.load(resources_dir + '/images/bg.png').convert_alpha()
|
||||
self.sprites = pygame.sprite.Group()
|
||||
|
||||
def update(self):
|
||||
self.blit(self.bg, (0, 0))
|
||||
self.sprites.update()
|
||||
self.sprites.draw(self)
|
@@ -1,16 +1,25 @@
|
||||
import pygame
|
||||
import time
|
||||
|
||||
|
||||
class Surface(pygame.Surface):
|
||||
def __init__(self, window_size, resources_dir):
|
||||
def __init__(self, window_size, resources_dir, game_fps):
|
||||
super().__init__(window_size, pygame.SRCALPHA)
|
||||
self.name = 'title'
|
||||
self.running = True
|
||||
self.next_surface = None
|
||||
|
||||
self.bg = pygame.image.load(resources_dir + '/images/bg.png').convert_alpha()
|
||||
self.title = pygame.image.load(resources_dir + '/images/title.png').convert_alpha()
|
||||
self.frames = 1
|
||||
self.game_fps = game_fps
|
||||
self.delay = 1
|
||||
|
||||
def update(self):
|
||||
self.blit(self.bg, (0, 0))
|
||||
self.blit(self.title, (0, 0))
|
||||
|
||||
self.frames += 1
|
||||
if self.frames > self.game_fps * self.delay:
|
||||
self.next_surface = 'egg_select'
|
||||
self.running = False
|
||||
|
Reference in New Issue
Block a user