added hardware check

This commit is contained in:
Nicholas Dyer 2023-05-12 23:17:33 -04:00
parent 5d3fc6ca49
commit 8e9e96d1bb

View File

@ -2,8 +2,11 @@ import pygame
import os import os
from pathlib import Path from pathlib import Path
import pocket_friends import pocket_friends
import importlib import importlib
from pocket_friends.game_files.io import gpio_handler
valid_surfaces = [ valid_surfaces = [
'title', 'title',
'egg_select', 'egg_select',
@ -38,7 +41,10 @@ def game():
# The game is normally rendered at 80 pixels and upscaled from there. If changing displays, change the # 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 to reflect what the resolution of the new display is.
screen_size = 320 screen_size = 320
if gpio_handler.ON_HARDWARE:
print('ON HARDWARE')
else:
print('NOT ON HARDWARE')
pygame.mouse.set_visible(False) pygame.mouse.set_visible(False)
pygame.display.set_caption('Pocket Friends {0}'.format(pocket_friends.__version__)) pygame.display.set_caption('Pocket Friends {0}'.format(pocket_friends.__version__))
window = pygame.display.set_mode((screen_size, screen_size)) window = pygame.display.set_mode((screen_size, screen_size))