from pygame import Surface

from lib.pgfw.pgfw.Sprite import Sprite

class Spikes(Sprite):

    def __init__(self, parent):
        Sprite.__init__(self, parent)
        self.load_configuration()
        self.set_frames()
        self.register(self.slide)
        self.reset()

    def load_configuration(self):
        config = self.get_configuration("spikes")
        self.delay = config["delay"]
        self.speed = config["speed"]

    def set_frames(self):
        surface = Surface((32, 8))
        surface.fill((0, 255, 0))
        self.add_frame(surface, omit=True)
        self.add_frameset(0, name="sliding")
        blank = Surface(self.location.size)
        blank.set_colorkey((0, 0, 0))
        self.add_frame(blank, omit=True)
        self.add_frameset([0, 1], self.parent.blink_rate, "queued")

    def reset(self):
        self.set_frameset("queued")
        self.halt(self.slide)
        self.active = False
        self.queue_reset = False
        self.location.center = self.display_surface.get_rect().right, \
                               self.parent.parent.platforms[0].location.top

    def queue_slide(self):
        self.active = True
        self.play(self.slide, delay=self.delay)

    def slide(self):
        self.set_frameset("sliding")
        self.move(-self.speed)
        if self.location.right <= self.display_surface.get_rect().left:
            self.queue_reset = True
        if self.location.colliderect(self.parent.parent.food):
            self.parent.parent.food.freeze()

    def update(self):
        if self.active:
            Sprite.update(self)
        if self.queue_reset:
            self.reset()
from random import randrange

from pygame import Surface

from lib.pgfw.pgfw.Sprite import Sprite

class Fireball(Sprite):

    def __init__(self, parent):
        Sprite.__init__(self, parent)
        self.load_configuration()
        self.set_frames()
        self.register(self.spew)
        self.reset()

    def load_configuration(self):
        config = self.get_configuration("fireball")
        self.delay = config["delay"]
        self.speed = config["speed"]
        self.peak = config["peak"]

    def set_frames(self):
        surface = Surface((24, 8))
        surface.fill((0, 255, 255))
        self.add_frame(surface, omit=True)
        self.add_frameset(0, name="spewing")
        blank = Surface(self.location.size)
        blank.set_colorkey((0, 0, 0))
        self.add_frame(blank, omit=True)
        self.add_frameset([0, 1], self.parent.blink_rate, "queued")

    def reset(self):
        self.halt(self.spew)
        self.set_frameset("queued")
        self.active = False
        self.queue_reset = False
        limit = self.display_surface.get_rect()
        self.location.midleft = randrange(0, limit.w - self.location.w), limit.h
        self.direction = -1

    def queue_spew(self):
        self.active = True
        self.play(self.spew, delay=self.delay)

    def spew(self):
        self.set_frameset("spewing")
        self.move(0, self.direction * self.speed)
        limit = self.parent.parent.platforms[0].location.top - self.peak
        if self.direction == -1 and self.location.centery <= limit:
            self.location.centery = limit
            self.direction = 1
        elif self.direction == 1 and \
             self.location.top >= self.display_surface.get_height():
            self.queue_reset = True
        if self.location.colliderect(self.parent.parent.food):
            self.parent.parent.food.freeze()

    def update(self):
        if self.active:
            Sprite.update(self)
        if self.queue_reset:
            self.reset()
from math import atan, degrees, radians, sqrt, sin, cos
from random import randint, randrange

from pygame import Surface
from pygame.transform import rotate

from lib.pgfw.pgfw.Sprite import Sprite

class Missile(Sprite):

    def __init__(self, parent):
        Sprite.__init__(self, parent)
        self.display_surface = self.get_display_surface()
        self.load_configuration()
        self.set_step()
        self.set_frames()
        self.register(self.fly)
        self.reset()

    def load_configuration(self):
        config = self.get_configuration("missile")
        self.margin = config["margin"]
        self.speed = config["speed"]
        self.peak = config["peak"]
        self.delay = config["delay"]
        self.angle = config["angle"]

    def set_step(self):
        angle = radians(self.angle)
        self.step = sin(angle) * self.speed, cos(angle) * self.speed

    def set_frames(self):
        surface = Surface((8, 32))
        surface.fill((255, 0, 0))
        surface.set_colorkey((255, 0, 255))
        self.add_frame(rotate(surface, self.angle), omit=True)
        self.add_frameset(0, name="flying")
        blank = Surface(self.location.size)
        blank.set_colorkey((0, 0, 0))
        self.add_frame(blank, omit=True)
        self.add_frameset([0, 1], self.parent.blink_rate, "queued")

    def reset(self):
        self.halt(self.fly)
        self.active = False
        self.queue_reset = False
        self.location.center = randrange(40, 640), 0
        self.set_frameset("queued")

    def is_flying(self):
        return self.is_playing(self.fly)

    def queue_fly(self):
        self.active = True
        self.play(self.fly, delay=self.delay)

    def fly(self):
        self.set_frameset("flying")
        self.move(*self.step)
        location = self.location
        if location.colliderect(self.parent.parent.food):
            self.parent.parent.food.freeze()
        if location.top > self.display_surface.get_height():
            self.queue_reset = True

    def update(self):
        if self.active:
            Sprite.update(self)
        if self.queue_reset:
            self.reset()
from lib.pgfw.pgfw.Sprite import Sprite

class Blob(Sprite):

    def __init__(self, parent):
        Sprite.__init__(self, parent)
        self.load_from_path(self.get_resource("blob", "path"), True, True,
                            query="*.png")
        self.hide()

    def hide(self):
        self.visible = False

    def show(self):
        self.visible = True

    def update(self):
        if self.visible:
            if not self.parent.horizontal:
                self.location.centerx = self.parent.parent.food.location.centerx
            else:
                self.location.centery = self.parent.parent.food.location.centery
            Sprite.update(self)
216.73.216.52
216.73.216.52
216.73.216.52
 
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.