from random import randint
from operator import sub

from pygame import Surface

from esp_hadouken.GameChild import *

class Barrier(GameChild, Surface):

    dir_r, dir_l = 1, -1

    def __init__(self, parent, y, sibling=None):
        GameChild.__init__(self, parent)
        self.y = y
        self.sibling = sibling
        self.init_surface()

    def init_surface(self):
        size = self.determine_size()
        Surface.__init__(self, (size, size))
        self.fill(self.parent.transparent_color)
        self.set_rect()

    def determine_size(self):
        parent = self.parent
        size_range = parent.size_range
        pos = float(self.y) / -sub(*parent.y_range)
        return pos * -sub(*size_range) + size_range[0]

    def set_rect(self):
        rect = self.get_rect()
        rect.top = self.y
        sibling = self.sibling
        if not sibling:
            growth = self.dir_r
            rect.top = self.y
            rect.left = self.generate_initial_x()
        else:
            growth = sibling.growth
            if growth == self.dir_r:
                rect.left = sibling.rect.right
                if rect.right > self.parent.get_width():
                    growth = self.dir_l
                    rect.right = sibling.rect.left
            if growth == self.dir_l:
                rect.right = sibling.rect.left
                if rect.left < 0:
                    growth = self.dir_r
                    rect.left = sibling.rect.right
        self.growth = growth
        self.rect = rect
        self.x = rect.left
        self.set_heading()
        self.set_step()

    def generate_initial_x(self):
        parent = self.parent
        return randint(0, parent.get_width() - parent.size_range[0])

    def set_heading(self):
        if self.rect.centerx > self.parent.get_width() / 2:
            heading = self.dir_l
        else:
            heading = self.dir_r
        self.heading = heading

    def set_step(self):
        parent = self.parent
        center = parent.get_width() / 2
        rnge = abs((self.rect.centerx - center) * 2)
        self.step = float(rnge) / parent.step_limit

    def toggle_heading(self):
        heading = self.heading
        if heading == self.dir_l:
            heading = self.dir_r
        else:
            heading = self.dir_l
        self.heading = heading

    def update(self):
        self.move()
        self.draw()

    def move(self):
        self.x += self.heading * self.step
        self.rect.left = self.x
        
    def draw(self):
        self.parent.area.blit(self, self.rect)
from esp_hadouken.levels.Level import *
from Gauntlet import *

class Horse(Level):

    def __init__(self, parent):
        Level.__init__(self, parent)

    def set_void(self):
        self.void = Gauntlet(self)
from random import randint
from operator import sub

from pygame import draw

from esp_hadouken.GameChild import *

class Bubble(GameChild):

    def __init__(self, parent, y=None):
        GameChild.__init__(self, parent)
        self.y = y
        self.set_x()

    def set_x(self):
        self.x = self.parent.get_width() / 2

    def update(self):
        self.y += self.parent.scroll_speed
        self.set_radius()

    def set_radius(self):
        parent = self.parent
        radius_range = parent.radius_range
        pos = float(self.y) / -sub(*parent.y_range)
        self.radius = int(pos * -sub(*radius_range) + radius_range[0])

    def draw(self):
        parent = self.parent
        center = self.x, self.y
        draw.circle(parent.area, parent.transparent_color, center, self.radius)
from random import randint

from pygame import Color, Surface

from esp_hadouken import levels
from Bubble import *

class Void(levels.Void.Void):

    def __init__(self, parent):
        levels.Void.Void.__init__(self, parent)
        self.iterations = 0
        self.read_configuration()
        self.set_area()
        self.show()

    def read_configuration(self):
        config = self.get_configuration()
        self.switch_frequency = config["tooth-level-switch-frequency"]
        self.scroll_speed = config["tooth-level-scroll-speed"]
        self.padding = config["tooth-level-void-padding"]
        self.radius_range = config["tooth-level-radius-range"]
        self.spawn_range = config["tooth-level-spawn-range"]

    def set_area(self):
        self.set_y_range()
        y_range = self.y_range
        height = y_range[1] - y_range[0]
        area = Surface((self.parent.get_width(), height)).convert()
        self.area_bg = Surface(area.get_size()).convert()
        self.area = area
        self.generate_bubbles()

    def set_y_range(self):
        padding = self.padding
        parent = self.parent
        start = parent.bandit.rect.bottom + padding[0]
        end = parent.get_height() - padding[1]
        self.y_range = start, end

    def generate_bubbles(self):
        self.bubbles = []
        y = self.get_height()
        while y > -self.radius_range[0]:
            self.add_bubble(y)
            y -= self.next_spawn + self.radius_range[0]

    def add_bubble(self, y=None):
        if y is None:
            y = -self.radius_range[0]
        self.bubbles.insert(0, Bubble(self, y))
        self.next_spawn = randint(*self.spawn_range)

    def toggle(self):
        if self.visible:
            self.hide()
        else:
            self.show()

    def show(self):
        self.visible = True

    def hide(self):
        self.visible = False

    def update_area(self):
        self.update_bubbles()
        iterations = self.iterations + 1
        if 1.0 / iterations <= self.switch_frequency:
            self.toggle()
            iterations = 0
        if self.visible:
            self.clear_area()
            self.draw_area()
        self.iterations = iterations

    def update_bubbles(self):
        bubbles = self.bubbles
        radius_range = self.radius_range
        if bubbles[0].y - radius_range[0] > self.next_spawn:
            self.add_bubble()
        for bubble in bubbles:
            if bubble.y > self.y_range[1] + radius_range[1]:
                bubbles.remove(bubble)
            else:
                bubble.update()

    def clear_area(self):
        self.area.blit(self.area_bg, (0, 0))

    def draw_area(self):
        self.draw_bubbles()
        self.blit(self.area, (0, self.y_range[0]))

    def draw_bubbles(self):
        for bubble in self.bubbles:
            bubble.draw()
34.204.193.85
34.204.193.85
34.204.193.85
 
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.