from random import choice, randrange

from pygame import Surface
from pygame.mixer import Sound

from _send.pgfw.Sprite import Sprite
from _send.Send import SoundEffect

class Cup(Sprite):

    def __init__(self, parent):
        Sprite.__init__(self, parent)
        self.display_surface = self.get_display_surface()
        self.set_frame()
        self.set_color()
        self.direction = choice((1, -1))
        self.moving = True
        self.wall_audio = SoundEffect(self.get_resource("cup", "wall-audio"),
                                      .8)

    def set_frame(self):
        size = self.get_size()
        surface = Surface((size, size))
        self.add_frame(surface)
        self.place()
        self.align()

    def get_size(self):
        return self.parent.cup_scale * self.display_surface.get_height() * \
               (1 - self.get_configuration("sideline", "proportion") * 2)

    def place(self):
        sidelines = self.parent.parent.sidelines
        self.rect.top = randrange(sidelines[0].bottom,
                                  sidelines[1].top - self.rect.h)

    def align(self):
        self.rect.right = self.display_surface.get_rect().right

    def set_color(self):
        self.color = self.parent.get_foreground_color()
        self.paint()

    def paint(self):
        self.get_current_frame().fill(self.color)

    def stop(self):
        self.moving = False

    def update(self):
        if self.moving:
            self.move(dy=self.parent.speed * self.direction)
            self.collide()
        Sprite.update(self)

    def collide(self):
        for sideline in self.parent.parent.sidelines:
            if self.location.colliderect(sideline):
                self.direction *= -1
                self.move(dy=sideline.clip(self.location).h * self.direction)
                self.wall_audio.play()
from pygame import Color, Surface, Rect
from pygame.time import get_ticks
from pygame.draw import circle
from pygame.mixer import Sound

from _send.pgfw.GameChild import GameChild
from _send.Send import SoundEffect

class Charge(GameChild):

    def __init__(self, parent):
        GameChild.__init__(self, parent)
        self.delegate = self.get_game().delegate
        self.display_surface = self.get_display_surface()
        self.charging_audio = SoundEffect(self.get_resource("charge",
                                                            "charging-audio"),
                                          .55)
        self.send_audio = SoundEffect(self.get_resource("charge",
                                                        "send-audio"), .1)
        self.load_configuration()
        self.subscribe(self.respond)
        self.reset()

    def load_configuration(self):
        config = self.get_configuration("charge")
        self.transparent_color = Color(*config["transparent-color"])
        self.colors = tuple(Color(color + "ff") for color in config["colors"])
        self.peak_time = config["peak-time"]
        self.size_limits = config["size-limits"]
        self.margin = config["margin"]

    def respond(self, event):
        fields = self.parent
        if not fields.loading and not fields.suppressing_input and \
               fields.get_current_field():
            if not self.sent and self.delegate.compare(event, "charge"):
                self.charging = True
                self.start = get_ticks()
            elif self.charging and self.delegate.compare(event, "charge", True):
                self.sent = True
                self.charging = False
                self.parent.get_current_field().ball.launch(self.get_strength())
                self.send_audio.play()

    def reset(self):
        self.charging = False
        self.start = None
        self.sent = False
        self.color_index = 0
        self.last_strength = None

    def get_strength(self):
        return float((get_ticks() - self.start) % self.peak_time) / \
               self.peak_time

    def update(self):
        if not self.sent and self.charging:
            self.increment_color_index()
            lower, upper = 4, 150
            if self.last_strength is None or \
                   self.last_strength > self.get_strength():
                self.charging_audio.play()
            strength = self.last_strength = self.get_strength()
            width = strength * (upper - lower) + lower
            lower, upper = 1, 22
            height = strength * (upper - lower) + lower
            rect = Rect(0, 0, width, height)
            rect.midbottom = self.parent.sidelines[1].midtop
            self.display_surface.fill(self.get_color(), rect)

    def increment_color_index(self):
        self.color_index += 1
        if self.color_index == len(self.colors):
            self.color_index = 0

    def get_color(self):
        return self.colors[self.color_index]
from pygame import Surface
from pygame.mixer import Sound

from _send.pgfw.Sprite import Sprite
from _send.Send import SoundEffect

class Ball(Sprite):

    def __init__(self, parent):
        Sprite.__init__(self, parent)
        self.display_surface = self.get_display_surface()
        self.set_frame()
        self.set_color()
        self.adjust_for_size()
        self.reset()
        self.reflect_audio = SoundEffect(self.get_resource("ball",
                                                           "reflect-audio"),
                                         .35)

    def set_frame(self):
        size = self.get_size()
        surface = Surface((size, size))
        self.add_frame(surface)
        self.center()

    def get_size(self):
        return self.parent.ball_scale * self.display_surface.get_height() * \
               (1 - self.get_configuration("sideline", "proportion") * 2)

    def center(self):
        self.rect.centery = self.display_surface.get_rect().centery

    def set_color(self):
        self.color = self.parent.get_foreground_color()
        self.paint()

    def paint(self):
        self.get_current_frame().fill(self.color)

    def adjust_for_size(self):
        lower, upper = self.get_configuration("ball", "base-velocity-range")
        ratio = self.rect.w / float(self.get_configuration("ball", "base-size"))
        self.velocity_range = ratio * lower, ratio * upper
        self.deceleration = ratio * self.get_configuration("ball",
                                                           "base-deceleration")

    def reset(self):
        self.velocity = 0

    def launch(self, strength):
        lower, upper = self.velocity_range
        self.velocity = strength * (upper - lower) + lower
        self.direction = 1

    def update(self):
        if self.velocity:
            self.move(self.velocity * self.direction)
            if self.rect.right >= self.display_surface.get_rect().right:
                self.direction = -1
                self.move(self.display_surface.get_rect().right - \
                          self.rect.right)
                self.reflect_audio.play()
            self.velocity -= self.deceleration
            if self.velocity < 1 or self.rect.right < 0:
                self.velocity = 0
                self.parent.cup.stop()
                self.parent.parent.result.evaluate()
        Sprite.update(self)
        if self.rect.colliderect(self.parent.cup.location):
            self.display_surface.fill(self.parent.get_background_color(),
                                      self.rect.clip(self.parent.cup.location))
18.222.231.86
18.222.231.86
18.222.231.86
 
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.