from os import environ

from pygame import display, image, mouse
from pygame.locals import *

from GameChild import *

class Display(GameChild):

    def __init__(self, game):
        GameChild.__init__(self, game)
        self.delegate = self.get_delegate()

    def load_configuration(self):
        config = self.get_configuration("display")
        self.centered = config["centered"]
        self.fullscreen_enabled = config["fullscreen"]
        self.caption = config["caption"]
        self.windowed_flag = config["windowed-flag"]
        self.icon_path = self.get_resource("display", "icon-path")
        self.mouse_visibility = self.get_configuration("mouse", "visible")

    def align_window(self):
        if self.centered:
            environ["SDL_VIDEO_CENTERED"] = "1"

    def init_screen(self):
        flags = 0
        if self.fullscreen_requested():
            flags = FULLSCREEN

    def fullscreen_requested(self):
        return not self.check_command_line(self.windowed_flag) and \

    def set_screen(self, flags=0, dimensions=None):
        self.dimensions_changed = dimensions is not None
        if dimensions is None:
            if display.get_surface():
                dimensions = display.get_surface().get_size()
                dimensions = self.get_configuration("display", "dimensions")
        self.screen = display.set_mode(dimensions, flags)
        if self.dimensions_changed:
            interpolator = self.get_game().interpolator
            if interpolator.gui_enabled:

    def set_caption(self):

    def set_icon(self):
        if self.icon_path:
            print self.icon_path

    def set_mouse_visibility(self, visibility=None):
        if visibility is None:
            visibility = self.mouse_visibility
        return mouse.set_visible(visibility)

    def get_screen(self):
        return self.screen

    def get_size(self):
        return self.screen.get_size()

    def toggle_fullscreen(self, event):
        if, "toggle-fullscreen"):
            screen = self.screen
            cpy = screen.convert()
            self.set_screen(self.screen.get_flags() ^ FULLSCREEN)
            screen.blit(cpy, (0, 0))
from os.path import exists, join, basename, normpath, abspath
from sys import argv

from pygame import mixer, event, time
from pygame.locals import *

import Game

class GameChild:

    def __init__(self, parent=None):
        self.parent = parent = self.get_game()

    def get_game(self):
        current = self
        while not isinstance(current, Game.Game):
            current = current.parent
        return current

    def get_configuration(self, section=None, option=None, linebreaks=True):
        config =
        if option is None and section is None:
            return config
        if option and section:
            rvalue = config.get(section, option)
            if not linebreaks and isinstance(rvalue, str):
                rvalue = rvalue.replace("\n", " ")
            return rvalue
        return config.get_section(section)

    def get_input(self):

    def get_screen(self):

    def get_display_surface(self):
        current = self
        attribute = "display_surface"
        while not isinstance(current, Game.Game):
            if hasattr(current, attribute):
                return getattr(current, attribute)
            current = current.parent
        return current.display.get_screen()

    def get_audio(self):

    def get_delegate(self):

    def get_resource(self, path_or_section, option=None):
        config = self.get_configuration()
        rel_path = path_or_section
        if option is not None:
            rel_path = config.get(path_or_section, option)
        if rel_path:
            for root in config.get("setup", "resource-search-path"):
                if self.is_shared_mode() and not self.is_absolute_path(root):
                path = join(root, rel_path)
                if exists(path):
                    return path
        self.print_debug("Couldn't find resource: {0} {1}".\
                                   format(path_or_section, option))

    def is_shared_mode(self):
        return self.check_command_line("s")

    def check_command_line(self, flag):
        return "-" + flag in argv

    def print_debug(self, statement):
        if self.is_debug_mode():
            print statement

    def is_debug_mode(self):
        return self.check_command_line("d")

    def is_absolute_path(self, path):
        return normpath(path) == abspath(path)

    def subscribe(self, callback, kind=None):, kind)

    def unsubscribe(self, callback, kind=None):, kind)
import cProfile
from time import strftime
from os import mkdir
from os.path import join, exists

from GameChild import GameChild

class Profile(cProfile.Profile, GameChild):

    def __init__(self, parent):
        GameChild.__init__(self, parent)
        if self.requested():

    def requested(self):
        return self.check_command_line("p")

    def end(self):
        if self.requested():
            root = "stat/"
            if not exists(root):
            self.dump_stats(join(root, strftime("%Y%m%d-%H%M_%S.stat")))
March 22, 2020

The chicken nugget business starter kit is now available online! Send me any amount of money through Venmo or PayPal, and I will mail you a package which will enable you to start a chicken nugget business of your own, play a video game any time you want, introduce a new character into your Animal Crossing village, and start collecting the chicken nugget trading cards.

The kit includes:

  • jellybean
  • instruction manual
  • limited edition trading card

By following the instructions you'll learn how to cook your own chicken or tofu nugget and be well on your way to financial success. I'm also throwing in one randomly selected card from the limited edition trading card set. Collect them, trade them, and if you get all eighteen and show me your set, I will give you an exclusive video game product.

All orders are processed within a day, so you can have your kit on your doorstep as quickly as possible. Don't sleep on this offer! Click the PayPal button or send a Venmo payment of any amount to @ohsqueezy, and in a matter of days you'll be counting money and playing video games.

PayPal me