You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.7 KiB

#!/usr/bin/env python3
# Scrapeboard is an arcade game in development by Frank DeMarco (@diskmem) and Blake Andrews (@snakesandrews).
# It requires custom hardware to play, but it can be tested in keyboard mode with just the code in this
# repository. For more information on setting up and running the game, see For more information
# on the game in general, visit <>.
# This is the launcher script that creates a main game object and runs it. If you're running Python 3 with
# the pygame module installed, you should be able to run this script with the --no-serial flag to get it
# running even without the custom hardware:
# ./OPEN-GAME --no-serial
import sys, os
def ignore_sighup():
Ignore hangup signal (that is thrown when launching from systemd?).
Taken from
import signal
def handler(signum, frame):
signal.signal(signal.SIGHUP, handler)
# Change directory to the directory of the program launching the script (usually this script "OPEN-GAME").
if "--go-to-dir" in sys.argv:
# Use the framebuffer display (for Raspberry Pi). This only works with Pygame 1.9.6 (and SDL 1.2).
if "--fb" in sys.argv:
os.putenv("SDL_VIDEODRIVER", "fbcon")
os.putenv("SDL_FBDEV", "/dev/fb0")
# Use the KMS video driver. This works for newer versions of Raspberry Pi with the KMS overlay
# enabled, SDL 2, and Pygame 2.
if "--kms" in sys.argv:
os.putenv("SDL_VIDEODRIVER", "kmsdrm")
from NS import NS