fixed game not rendering on hardware

This commit is contained in:
Nicholas Dyer 2023-05-12 23:21:33 -04:00
parent 8e9e96d1bb
commit 9b752bde21

View File

@ -40,19 +40,19 @@ def game():
# The game is normally rendered at 80 pixels and upscaled from there. If changing displays, change the
# screen_size to reflect what the resolution of the new display is.
screen_size = 320
if gpio_handler.ON_HARDWARE:
print('ON HARDWARE')
screen_size = 240
pygame.mouse.set_visible(False)
window = pygame.display.set_mode((screen_size, screen_size), pygame.FULLSCREEN)
else:
print('NOT ON HARDWARE')
pygame.mouse.set_visible(False)
pygame.display.set_caption('Pocket Friends {0}'.format(pocket_friends.__version__))
window = pygame.display.set_mode((screen_size, screen_size))
screen_size = 240*2
window = pygame.display.set_mode((screen_size, screen_size))
surface = surface_modules.get(starting_surface).Surface((game_res, game_res), resources_dir, game_fps)
# Add an icon to the pygame window.
icon = pygame.image.load(resources_dir + '/icon/icon.png').convert_alpha()
pygame.display.set_icon(icon)
pygame.display.set_caption('Pocket Friends {0}'.format(pocket_friends.__version__))
# Default game state when the game first starts.
running = True