from pygame import Surface
from pygame.locals import *
from pygame.image import load

from esp_hadouken.pgfw.GameChild import GameChild

class Glass(GameChild):

    def __init__(self, parent):
        GameChild.__init__(self, parent)
        self.display_surface = self.get_screen()
        self.load_image()

    def load_image(self):
        self.image = load(self.get_resource("title", "glass-path")).convert()

    def update(self):
        self.display_surface.blit(self.image, (0, 0), None, BLEND_MAX)
from pygame.locals import *
from pygame.image import load
from pygame.font import Font

from esp_hadouken.pgfw.GameChild import GameChild
from esp_hadouken.pgfw.Input import Input
from esp_hadouken.Toy import Toy
from esp_hadouken.title.background.Background import Background
from esp_hadouken.title.menu.Menu import Menu
from esp_hadouken.title.Glass import Glass

class Title(GameChild):

    def __init__(self, parent):
        GameChild.__init__(self, parent)
        self.leave_limit = self.get_screen().get_rect().right
        self.audio_path = self.get_resource("title", "audio-path")
        self.toy_position = self.get_configuration("title", "toy-position")
        self.delegate = self.get_delegate()
        self.deactivate()
        self.set_children()
        self.place_toy()
        self.subscribe(self.respond)

    def deactivate(self):
        self.active = False

    def set_children(self):
        self.toy = Toy(self)
        self.background = Background(self)
        self.glass = Glass(self)
        self.menu = Menu(self)

    def place_toy(self):
        self.toy.rect.topleft = self.toy_position

    def respond(self, event):
        compare = self.delegate.compare
        if compare(event, "reset-game"):
            self.activate()
        elif compare(event, "main-menu-selection", option="play"):
            self.deactivate()
        elif compare(event, "main-menu-selection", option="records"):
            self.deactivate()

    def activate(self):
        self.active = True
        self.start_music()

    def start_music(self):
        self.get_audio().play_bgm(self.audio_path)

    def update(self):
        if self.active:
            self.background.update()
            self.toy.update()
            self.glass.update()
            self.menu.update()
from pygame import Rect

from esp_hadouken.pgfw.GameChild import GameChild
from esp_hadouken.title.menu.Option import Option

class Menu(Rect, GameChild):

    def __init__(self, parent):
        GameChild.__init__(self, parent)
        self.display_surface = self.get_screen()
        self.fx = self.get_configuration("main-menu", "select-fx")
        self.delegate = self.get_delegate()
        self.init_rect()
        self.add_options()
        self.subscribe(self.respond)

    def init_rect(self):
        Rect.__init__(self, (0, 0), self.get_configuration("main-menu", "size"))
        self.center = self.display_surface.get_rect().center

    def add_options(self):
        self.options = [Option(self, ii) for ii in range(2)]

    def respond(self, event):
        if self.parent.active:
            compare = self.delegate.compare
            if compare(event, ["left", "right"]):
                play = self.get_audio().play_fx
                post = self.delegate.post
                name = "main-menu-selection"
                if compare(event, "left"):
                    play(self.fx[0])
                    post(name, option="play")
                elif compare(event, "right"):
                    play(self.fx[1])
                    post(name, option="records")

    def apply_to_options(self, name):
        for option in self.options:
            getattr(option, name)()

    def update(self):
        self.apply_to_options("update")
from random import randint

from pygame import Surface, PixelArray, Rect
from pygame.font import Font

from esp_hadouken.pgfw.Sprite import Sprite

class Option(Sprite):

    def __init__(self, parent, index):
        Sprite.__init__(self, parent)
        self.index = index
        self.load_configuration()
        self.set_framerate(self.framerate)
        self.add_frames()
        self.place()

    def load_configuration(self):
        config = self.get_configuration("main-menu")
        self.framerate = config["framerate"]
        self.width = config["option-width"]
        self.frame_count = config["frame-count"]
        self.text_color = config["text-color"]
        self.text_size = config["text-size"]
        self.text = config["option-text"]
        self.background_color_range = config["background-color-range"]
        self.font_path = self.get_resource("main-menu", "font-path")

    def add_frames(self):
        size = self.width, self.parent.h
        for ii in range(self.frame_count):
            surface = Surface(size)
            self.randomize(surface)
            self.add_text(surface)
            self.add_frame(surface)

    def randomize(self, surface):
        pixels = PixelArray(surface)
        for ii, column in enumerate(pixels):
            for jj, pixel in enumerate(column):
                pixels[ii][jj] = self.build_random_color()

    def build_random_color(self):
        color = self.background_color_range
        return randint(*color), randint(*color), randint(*color)

    def add_text(self, parent):
        index, color, antialias = self.index, self.text_color, True
        font = Font(self.font_path, self.text_size)
        if index == 0:
            surface = font.render(self.text[0], antialias, color)
        elif index == 1:
            surface = font.render(self.text[1], antialias, color)
        rect = surface.get_rect()
        rect.center = parent.get_rect().center
        parent.blit(surface, rect)

    def place(self):
        index = self.index
        if index == 0:
            self.rect.topleft = self.parent.topleft
        elif index == 1:
            self.rect.topright = self.parent.topright
from math import pi

from pygame import Surface, Rect
from pygame.draw import arc

from esp_hadouken.pgfw.Sprite import Sprite

class Sky(Sprite):

    def __init__(self, parent):
        Sprite.__init__(self, parent)
        self.load_configuration()
        self.add_frames()
        self.set_framerate(self.framerate)

    def load_configuration(self):
        config = self.get_configuration("title")
        self.framerate = config["sky-framerate"]
        self.step = config["sky-arc-step"]
        self.arc_thickness = config["sky-arc-thickness"]
        self.arc_color = config["sky-arc-color"]
        self.color = config["sky-color"]

    def add_frames(self):
        for ii in 0, 1:
            offset = -ii * self.step / 2
            surface = Surface(self.display_surface.get_size())
            surface.fill(self.color)
            self.draw_arcs(surface, offset)
            self.add_frame(surface)

    def draw_arcs(self, surface, offset):
        step = self.step
        reference = self.display_surface.get_rect()
        limit = reference.w
        rect = Rect(0, 0, step + offset, step + offset)
        center = reference.centerx, reference.bottom
        rect.center = center
        start_angle = pi / 2
        thickness = self.arc_thickness
        color = self.arc_color
        while rect.w / 2 <= limit:
            arc(surface, color, rect, start_angle, 0, thickness)
            rect.w += step
            rect.h += step
            rect.center = center
35.175.191.72
35.175.191.72
35.175.191.72
 
December 3, 2013

Where in the mind's prism does light shine, inward, outward, or backward, and where in a plane does it intersect, experientially and literally, while possessing itself in a dripping wet phantasm?


Fig 1.1 What happens after you turn on a video game and before it appears?

The taxonomy of fun contains the difference between gasps of desperation and exaltation, simultaneously identical and opposite; one inspires you to have sex, while the other to ejaculate perpetually. A destruction and its procession are effervescent, while free play is an inseminated shimmer hatching inside you. Unlikely to be resolved, however, in such a way, are the climaxes of transitions between isolated, consecutive game states.

You walk through a door or long-jump face first (your face, not Mario's) into a painting. A moment passes for eternity, viscerally fading from your ego, corpus, chakra, gaia, the basis of your soul. It happens when you kill too, and especially when you precisely maim or obliterate something. It's a reason to live, a replicating stasis.


Fig 1.2 Sequence in a video game

Video games are death reanimated. You recurse through the underworld toward an illusion. Everything in a decision and logic attaches permanently to your fingerprint. At the core, you use its energy to soar, comatose, back into the biosphere, possibly because the formal structure of a mind by human standards is useful in the next world.