from re import match
from os.path import join
from tempfile import gettempdir

from pygame import Surface
from pygame.font import Font
from pygame.draw import aaline
from pygame.locals import *

from GameChild import GameChild
from Sprite import Sprite
from Animation import Animation

class Interpolator(list, GameChild):

    def __init__(self, parent):
        GameChild.__init__(self, parent)
        self.gui_enabled = self.check_command_line("-interpolator")
        if self.gui_enabled:
            self.gui = GUI(self)

    def set_nodesets(self):
        config = self.get_configuration()
        if config.has_section("interpolate"):
            for name, value in config.get_section("interpolate").iteritems():
                self.add_nodeset(name, value)

    def add_nodeset(self, name, value, method=None):
        self.append(Nodeset(name, value, method))
        return len(self) - 1

    def is_gui_active(self):
        return self.gui_enabled and

    def get_nodeset(self, name):
        for nodeset in self:
            if == name:
                return nodeset

    def remove(self, outgoing):
        for ii, nodeset in enumerate(self):
            if ==

class Nodeset(list):

    LINEAR, CUBIC = range(2)

    def __init__(self, name, nodes, method=None):
        list.__init__(self, []) = name
        if isinstance(nodes, str):
            self.interpolation_method = method

    def parse_raw(self, raw):
        raw = raw.strip()
        if raw[0].upper() == "L":
            self.set_interpolation_method(self.LINEAR, False)
            self.set_interpolation_method(self.CUBIC, False)
        for node in raw[1:].strip().split(","):
            self.add_node(map(float, node.strip().split()), False)

    def set_interpolation_method(self, method, refresh=True):
        self.interpolation_method = method
        if refresh:

    def add_node(self, coordinates, refresh=True):
        x = coordinates[0]
        inserted = False
        index = 0
        for ii, node in enumerate(self):
            if x < node.x:
                self.insert(ii, Node(coordinates))
                inserted = True
                index = ii
            elif x == node.x:
                return None
        if not inserted:
            index = len(self) - 1
        if refresh:
        return index

    def parse_list(self, nodes):
        for node in nodes:

    def set_splines(self):
        if self.interpolation_method == self.LINEAR:

    def set_linear_splines(self):
        self.splines = splines = []
        for ii in xrange(len(self) - 1):
            x1, y1, x2, y2 = self[ii] + self[ii + 1]
            m = float(y2 - y1) / (x2 - x1)
            splines.append(LinearSpline(x1, y1, m))

    def set_cubic_splines(self):
        n = len(self) - 1
        a = [node.y for node in self]
        b = [None] * n
        d = [None] * n
        h = [self[ii + 1].x - self[ii].x for ii in xrange(n)]
        alpha = [None] + [(3.0 / h[ii]) * (a[ii + 1] - a[ii]) - \
                          (3.0 / h[ii - 1]) * (a[ii] - a[ii - 1]) \
                          for ii in xrange(1, n)]
        c = [None] * (n + 1)
        l = [None] * (n + 1)
        u = [None] * (n + 1)
        z = [None] * (n + 1)
        l[0] = 1
        u[0] = z[0] = 0
        for ii in xrange(1, n):
            l[ii] = 2 * (self[ii + 1].x - self[ii - 1].x) - \
                    h[ii - 1] * u[ii - 1]
            u[ii] = h[ii] / l[ii]
            z[ii] = (alpha[ii] - h[ii - 1] * z[ii - 1]) / l[ii]
        l[n] = 1
        z[n] = c[n] = 0
        for jj in xrange(n - 1, -1, -1):
            c[jj] = z[jj] - u[jj] * c[jj + 1]
            b[jj] = (a[jj + 1] - a[jj]) / h[jj] - \
                    (h[jj] * (c[jj + 1] + 2 * c[jj])) / 3
            d[jj] = (c[jj + 1] - c[jj]) / (3 * h[jj])
        self.splines = [CubicSpline(self[ii].x, a[ii], b[ii], c[ii],
                                    d[ii]) for ii in xrange(n)]

    def get_y(self, t, loop=False, reverse=False, natural=False):
        if loop or reverse:
            if reverse and int(t) / int(self[-1].x) % 2:
                t = self[-1].x - t
            t %= self[-1].x
        elif not natural:
            if t < self[0].x:
                t = self[0].x
            elif t > self[-1].x:
                t = self[-1].x
        splines = self.splines
        for ii in xrange(len(splines) - 1):
            if t < splines[ii + 1].x:
                return splines[ii].get_y(t)
        return splines[-1].get_y(t)

    def remove(self, node, refresh=True):
        list.remove(self, node)
        if refresh:

    def resize(self, left, length, refresh=True):
        old_left = self[0].x
        old_length = self.get_length()
        for node in self:
            node.x = left + length * (node.x - old_left) / old_length
        if refresh:

    def get_length(self):
        return self[-1].x - self[0].x

class Node(list):

    def __init__(self, coordinates):
        list.__init__(self, coordinates)

    def __getattr__(self, name):
        if name == "x":
            return self[0]
        elif name == "y":
            return self[1]
        return list.__get__(self, name)

    def __setattr__(self, name, value):
        if name == "x":
            list.__setitem__(self, 0, value)
        elif name == "y":
            list.__setitem__(self, 1, value)
            list.__setattr__(self, name, value)

class Spline:

    def __init__(self, x):
        self.x = x

class CubicSpline(Spline):

    def __init__(self, x, a, b, c, d):
        Spline.__init__(self, x)
        self.a = a
        self.b = b
        self.c = c
        self.d = d

    def get_y(self, t):
        x = self.x
        return self.a + self.b * (t - x) + self.c * (t - x) ** 2 + self.d * \
               (t - x) ** 3

class LinearSpline(Spline):

    def __init__(self, x, y, m):
        Spline.__init__(self, x)
        self.y = y
        self.m = m

    def get_y(self, t):
        return self.m * (t - self.x) + self.y

class GUI(Animation):

    S_NONE, S_LEFT, S_RIGHT = range(3)

    def __init__(self, parent):
        Animation.__init__(self, parent, unfiltered=True) = self.get_audio()
        self.display = self.get_game().display
        self.display_surface = self.get_display_surface()
        self.time_filter = self.get_game().time_filter
        self.delegate = self.get_delegate()
        self.split = self.S_NONE
        self.success_indicator_active = True
        self.success_indicator_blink_count = 0
        self.font = Font(None, self.label_size)
        self.prompt = Prompt(self)
        self.set_buttons() = False
        self.subscribe(self.respond_to_mouse_down, MOUSEBUTTONDOWN)
        self.subscribe(self.respond_to_key, KEYDOWN)
        self.register(self.show_success_indicator, interval=100)
        self.register(self.save_temporary_file, interval=10000)

    def load_configuration(self):
        config = self.get_configuration("interpolator-gui")
        self.label_size = config["label-size"]
        self.axis_label_count = config["axis-label-count"]
        self.margin = config["margin"]
        self.curve_color = config["curve-color"]
        self.marker_size = config["marker-size"]
        self.marker_color = config["marker-color"]
        self.label_precision = config["label-precision"]
        self.template_nodeset = config["template-nodeset"]
        self.template_nodeset_name = config["template-nodeset-name"]
        self.flat_y_range = config["flat-y-range"]

    def set_temporary_file(self):
        self.temporary_file = open(join(gettempdir(), "pgfw-config"), "w")

    def set_background(self):
        surface = Surface(self.display_surface.get_size())
        surface.fill((0, 0, 0))
        self.background = surface

    def set_success_indicator(self):
        surface = Surface((10, 10))
        surface.fill((0, 255, 0))
        rect = surface.get_rect()
        rect.topleft = self.display_surface.get_rect().topleft
        self.success_indicator, self.success_indicator_rect = surface, rect

    def set_plot_rect(self):
        margin = self.margin
        self.plot_rect = self.display_surface.get_rect().inflate(-margin,

    def set_marker_frame(self):
        size = self.marker_size
        surface = Surface((size, size))
        transparent_color = (255, 0, 255)
        line_color = self.marker_color
        aaline(surface, line_color, (0, 0), (size - 1, size - 1))
        aaline(surface, line_color, (0, size - 1), (size - 1, 0))
        self.marker_frame = surface

    def set_buttons(self):
        self.buttons = buttons = []
        text = "Duplicate", "Write", "Delete", "Linear", "Cubic", "Split: No"
        x = 0
        for instruction in text:
            buttons.append(Button(self, instruction, x))
            x += buttons[-1].location.w + 10

    def set_nodeset_index(self, increment=None, index=None):
        parent = self.parent
        if index is None:
            if not increment:
                index = 0
                index = self.nodeset_index + increment
                limit = len(parent) - 1
                if index > limit:
                    index = 0
                elif index < 0:
                    index = limit
        self.nodeset_index = index

    def set_nodeset_label(self):
        surface = self.font.render(self.get_nodeset().name, True, (0, 0, 0),
                                   (255, 255, 255))
        rect = surface.get_rect()
        rect.bottomright = self.display_surface.get_rect().bottomright
        self.nodeset_label, self.nodeset_label_rect = surface, rect

    def get_nodeset(self):
        if not len(self.parent):
        return self.parent[self.nodeset_index]

    def set_y_range(self):
        width = self.plot_rect.w
        nodeset = self.get_nodeset()
        self.y_range = y_range = [nodeset[0].y, nodeset[-1].y]
        x = 0
        while x < width:
            y = nodeset.get_y(self.get_function_coordinates(x)[0])
            if y < y_range[0]:
                y_range[0] = y
            elif y > y_range[1]:
                y_range[1] = y
            x += width * .01
        if y_range[1] - y_range[0] == 0:
            y_range[1] += self.flat_y_range
        if self.split:
            self.adjust_for_split(y_range, nodeset)

    def get_function_coordinates(self, xp=0, yp=0):
        nodeset = self.get_nodeset()
        x_min, x_max, (y_min, y_max) = nodeset[0].x, nodeset[-1].x, self.y_range
        rect = self.plot_rect
        x = float(xp) / (rect.right - rect.left) * (x_max - x_min) + x_min
        y = float(yp) / (rect.bottom - * (y_min - y_max) + y_max
        return x, y

    def adjust_for_split(self, y_range, nodeset):
        middle = nodeset[0].y if self.split == self.S_LEFT else nodeset[-1].y
        below, above = middle - y_range[0], y_range[1] - middle
        if below > above:
            y_range[1] += below - above
            y_range[0] -= above - below

    def set_axis_labels(self):
        self.axis_labels = labels = []
        nodeset, formatted, render, rect, yr = (self.get_nodeset(),
                                                self.plot_rect, self.y_range)
        for ii, node in enumerate(nodeset[0::len(nodeset) - 1]):
            xs = render(formatted(node.x), True, (0, 0, 0), (255, 255, 255))
            xsr = xs.get_rect()
   = rect.bottom
            if not ii:
                xsr.left = rect.left
                xsr.right = rect.right
            ys = render(formatted(yr[ii]), True, (0, 0, 0), (255, 255, 255))
            ysr = ys.get_rect()
            ysr.right = rect.left
            if not ii:
                ysr.bottom = rect.bottom
            labels.append(((xs, xsr), (ys, ysr)))

    def get_formatted_measure(self, measure):
        return "%s" % float(("%." + str(self.label_precision) + "g") % measure)

    def deactivate(self): = False = self.saved_mute_state

    def respond_to_command(self, event):
        compare =
        if compare(event, "toggle-interpolator"):
            if compare(event, "reset-game"):
            elif compare(event, "quit"):

    def toggle(self):

    def activate(self): = True
        self.saved_mute_state =
        self.saved_mouse_state = self.display.set_mouse_visibility(True)

    def respond_to_mouse_down(self, event):
        redraw = False
        if and not
            nodeset_rect = self.nodeset_label_rect
            plot_rect = self.plot_rect
            if event.button == 1:
                pos = event.pos
                if nodeset_rect.collidepoint(pos):
                    redraw = True
                elif self.axis_labels[0][0][1].collidepoint(pos):
                    text = "{0} {1}".format(*map(self.get_formatted_measure,
                    self.prompt.activate(text, self.resize_nodeset, 0)
                elif self.axis_labels[1][0][1].collidepoint(pos):
                    text = "{0} {1}".format(*map(self.get_formatted_measure,
                    self.prompt.activate(text, self.resize_nodeset, -1)
                    bi = self.collide_buttons(pos)
                    if bi is not None:
                        if bi == self.B_WRITE:
                        elif bi in (self.B_LINEAR, self.B_CUBIC):
                            nodeset = self.get_nodeset()
                            if bi == self.B_LINEAR:
                            redraw = True
                        elif bi == self.B_DUPLICATE:
                            self.prompt.activate("", self.add_nodeset)
                        elif bi == self.B_DELETE and len(self.parent) > 1:
                            redraw = True
                        elif bi == self.B_SPLIT:
                            redraw = True
                    elif plot_rect.collidepoint(pos) and \
                             not self.collide_markers(pos):
                        xp, yp = pos[0] - plot_rect.left, pos[1] -
                            self.get_function_coordinates(xp, yp))
                        redraw = True
            elif event.button == 3:
                pos = event.pos
                if nodeset_rect.collidepoint(pos):
                    redraw = True
                elif plot_rect.collidepoint(pos):
                    marker = self.collide_markers(pos)
                    if marker:
                        redraw = True
        elif and and \
                 not self.prompt.rect.collidepoint(event.pos):
            redraw = True
        if redraw:

    def resize_nodeset(self, text, index):
        result = match("^\s*(-{,1}\d*\.{,1}\d*)\s+(-{,1}\d*\.{,1}\d*)\s*$",
        if result:
                nodeset = self.get_nodeset()
                x, y = map(float,, 2))
                if (index == -1 and x > nodeset[0].x) or \
                       (index == 0 and x < nodeset[-1].x):
                    nodeset[index].y = y
                    if index == -1:
                        nodeset.resize(nodeset[0].x, x - nodeset[0].x)
                        nodeset.resize(x, nodeset[-1].x - x)
                    return True
            except ValueError:
                return False

    def collide_buttons(self, pos):
        for ii, button in enumerate(self.buttons):
            if button.location.collidepoint(pos):
                return ii

    def store_in_configuration(self):
        config = self.get_configuration()
        section = "interpolate"
        for nodeset in self.parent:
            code = "L" if nodeset.interpolation_method == Nodeset.LINEAR else \
            for ii, node in enumerate(nodeset):
                if ii > 0:
                    code += ","
                code += " {0} {1}".format(*map(self.get_formatted_measure,
            if not config.has_section(section):
            config.set(section,, code)

    def toggle_split(self):
        self.split += 1
        if self.split > self.S_RIGHT:
            self.split = self.S_NONE
        self.buttons[self.B_SPLIT].set_frame(["Split: No", "Split: L",
                                              "Split: R"][self.split])

    def add_nodeset(self, name):
        nodeset = self.get_nodeset()
            name, nodeset, nodeset.interpolation_method))
        return True

    def collide_markers(self, pos):
        for marker in self.markers:
            if marker.location.collidepoint(pos):
                return marker

    def set_markers(self):
        self.markers = markers = []
        for node in self.get_nodeset()[1:-1]:
            markers.append(Marker(self, node))
            markers[-1] = self.get_plot_coordinates(*node)

    def get_plot_coordinates(self, x=0, y=0):
        nodeset = self.get_nodeset()
        x_min, x_max, (y_min, y_max) = nodeset[0].x, nodeset[-1].x, self.y_range
        x_ratio = float(x - x_min) / (x_max - x_min)
        rect = self.plot_rect
        xp = x_ratio * (rect.right - rect.left) + rect.left
        y_ratio = float(y - y_min) / (y_max - y_min)
        yp = rect.bottom - y_ratio * (rect.bottom -
        return xp, yp

    def draw(self):
        display_surface = self.display_surface
        display_surface.blit(self.background, (0, 0))
        display_surface.blit(self.nodeset_label, self.nodeset_label_rect)

    def draw_axes(self):
        display_surface = self.display_surface
        for xl, yl in self.axis_labels:

    def draw_function(self):
        rect = self.plot_rect
        surface = self.display_surface
        nodeset = self.get_nodeset()
        step = 1
        for x in xrange(rect.left, rect.right + step, step):
            ii = x - rect.left
            fx = nodeset.get_y(self.get_function_coordinates(ii)[0])
            y = self.get_plot_coordinates(y=fx)[1]
            if ii > 0:
                aaline(surface, self.curve_color, (x - step, last_y), (x, y))
            last_y = y

    def draw_markers(self):
        for marker in self.markers:

    def draw_buttons(self):
        for button in self.buttons:

    def respond_to_key(self, event):
            prompt = self.prompt
            if event.key == K_RETURN:
                if prompt.callback[0](prompt.text, *prompt.callback[1]):
            elif event.key == K_BACKSPACE:
                prompt.text = prompt.text[:-1]
            elif (event.unicode.isalnum() or event.unicode.isspace() or \
                  event.unicode in (".", "-", "_")) and len(prompt.text) < \
                prompt.text += event.unicode

    def show_success_indicator(self):
        if self.success_indicator_blink_count > 1:
            self.success_indicator_blink_count = 0
            if self.success_indicator_active:
            if self.success_indicator_active:
                self.success_indicator_blink_count += 1
            self.success_indicator_active = not self.success_indicator_active

    def save_temporary_file(self):
        fp = self.temporary_file

    def rearrange(self):

class Marker(Sprite):

    def __init__(self, parent, node):
        Sprite.__init__(self, parent)
        self.node = node

class Button(Sprite):

    def __init__(self, parent, text, left):
        Sprite.__init__(self, parent)
        self.location.bottomleft = left, \

    def set_frame(self, text):
        self.add_frame(self.parent.font.render(text, True, (0, 0, 0),
                                               (255, 255, 255)))

class Prompt(Sprite):

    def __init__(self, parent):
        Sprite.__init__(self, parent)
        self.font = Font(None, self.text_size)

    def deactivate(self): = False

    def load_configuration(self):
        config = self.get_configuration("interpolator-gui")
        self.size = config["prompt-size"]
        self.border_color = config["prompt-border-color"]
        self.border_width = config["prompt-border-width"]
        self.character_limit = config["prompt-character-limit"]
        self.text_size = config["prompt-text-size"]

    def reset(self):

    def set_frame(self):
        surface = Surface(self.size)
        width = self.border_width * 2
        surface.fill((0, 0, 0), surface.get_rect().inflate(-width, -width))

    def place(self): = self.display_surface.get_rect().center

    def activate(self, text, callback, *args): = True
        self.text = str(text)
        self.callback = callback, args

    def draw_text(self):
        surface = self.font.render(self.text, True, (255, 255, 255), (0, 0, 0))
        rect = surface.get_rect() =
        self.display_surface.blit(surface, rect)
March 3, 2021

Video 📺

Computers are a gun. They can see the target; they can pull the trigger. Computers were made by the military to blow people's brains out if they stepped out of line. Google Coral is the same technology that pollutes the oceans, and so is the computer I'm using, and so are the platforms I'm using to post this.

Game 🎲

Games are a context in which all play is purposeful. Games expose the fundamentally nihilistic nature of the universe and futility of pursuing any path other than the inevitability of death and the torture of an evil that knows and exploits absolute freedom. Games are not educational; they are education.

Propaganda 🆒

Education is propaganda — ego driven by-product conveying nothing that would enable us to expose that vanities made for gain subject us further to an illusion created by those in control: the illusion that quantity can represent substance and that data or observation can replace meaning. And why say it, or how, without contradicting yourself, that everything, once registered, no longer exists, and in fact never did, exists only in relation to other non-existent things, and when you look, it's not there, not only because it's long vanished, but because where would it be?

fig. 2: Gamer goo is a lubricant — not for your skin, but for facilitating your ability to own the competition (image from Gamer goo review)

As a result of video games, the great Trojan horse 🎠 of imperialist consumerist representationalism, people are divided in halves to encourage them to act according to market ordained impulses, to feign assurance, penetrating themselves deeper into a tyranny from which every action signals allegiance, confusing the world with definitions and borders, constantly struggling to balance or brace themselves against forces that threaten the crumbling stability of their ego.


or example, a cup 🥃 is designed and built to hold something, maintain order and prevent chaos. It keeps water from spilling back to where it belongs, back where it wants to go and gravity wants it to go. The cup is a trap, and it is used to assert dominance over nature, to fill with thoughts about existence, time and self, thoughts regarding dissimilarity between equal parts and patterns that manifest in variation. These ruminations disguised as revelations boil away to reveal isolated and self-aggrandizing thoughts about an analogy fabricated to herald the profundity of one's campaign's propaganda. You have no authentic impulse except to feed a delusion of ultimate and final supremacy. That is why you play games. That is your nature. That is why you eventually smash the cup to bits 💥 or otherwise watch it disintegrate forever because it, by being useful, threatens your facade of ownership and control.

fig. 3: worth1000

The cup is you; it reflects you; it is a lens through which you see yourself; it reassures you, confirming your presence; it says something, being something you can observe. When you move, it moves, and it opens after being closed. You can use it as a vessel for penetration fantasies, keeping you warm and fertile, a fine host for the plague of consciousness, you reptile, you sun scorched transgressor that not only bites the hand that feeds, but buries it deep within a sterile chamber where nothing remains for it as a means of escape except the corpses of others that infringed upon your feeding frenzy.

January 23, 2021

I wanted to document this chat-controlled robot I made for Babycastles' LOLCAM📸 that accepts a predefined set of commands like a character in an RPG party 〰 commands like walk, spin, bash, drill. It can also understand donut, worm, ring, wheels, and more. The signal for each command is transmitted as a 24-bit value over infrared using two Arduinos, one with an infrared LED, and the other with an infrared receiver. I built the transmitter circuit, and the receiver was built into the board that came with the mBot robot kit. The infrared library IRLib2 was used to transmit and receive the data as a 24-bit value.

fig. 1.1: the LEDs don't have much to do with this post!

I wanted to control the robot the way the infrared remote that came with the mBot controlled it, but the difference would be that since we would be getting input from the computer, it would be like having a remote with an unlimited amount of buttons. The way the remote works is each button press sends a 24-bit value to the robot over infrared. Inspired by Game Boy Advance registers and tracker commands, I started thinking that if we packed multiple parameters into the 24 bits, it would allow a custom move to be sent each time, so I wrote transmitter and receiver code to process commands that looked like this:

multiply by 64 to get duration of command in ms
multiply by 16 to get left motor power
multiply by 16 to get right motor power
left sign
0 = left wheel backward, 1 = left wheel forward
right sign
0 = right wheel forward, 1 = right wheel backward
robot id
0 = send to player one, 1 = send to player two
negate motor signs when repeating command
number of times to repeat command
multiply by 128 to get time between repeats in ms
swap the motor power values on repeat
fig 1.2: tightly stuffed bits

The first command I was able to send with this method that seemed interesting was one that made the mBot do a wheelie.

$ ./ 15 12 15 1 0 0 0 7 0 1
sending 0xff871fcf...

fig 1.3: sick wheels

A side effect of sending the signal this way is any button on any infrared remote will cause the robot to do something. The star command was actually reverse engineered from looking at the code a random remote button sent. For the robot's debut, it ended up with 15 preset commands (that number is in stonks 📈). I posted a highlights video on social media of how the chat controls turned out.

This idea was inspired by a remote frog tank LED project I made for Ribbit's Frog World which had a similar concept: press a button, and in a remote location where 🐸 and 🐠 live, an LED would turn on.

fig 2.1: saying hi to froggo remotely using an LED

😇 The transmitter and receiver Arduino programs are available to be copied and modified 😇

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

June 23, 2019

is pikachu dead

yes and how about that for a brain tickler that what you're seeing all along was a ghost. we used a digital stream of bits that in the future we call blood to recreate everything as a malleable substance that is projected through computers over a massive interstellar network that runs faster than the speed of light in order to simultaneously exist at every moment in time exactly the same way effectively creating a new dimension through which you can experience the timeless joy of video games. you can press a button and watch the impact of your actions instantaneously resonate eternally across an infinite landscape as you the master of a constantly regenerating universe supplant your reality with your imagination giving profoundly new meaning to the phrase what goes around comes around as what comes around is the manifestation of the thoughts you had before you were aware of them. thoughts before they were thought and actions before they were done! it's so revolutionary we saved it for 10,000 years from now but it's all recycled here in the past with you at the helm and the future at the tips of your fingers

June 7, 2018

May 17, 2018

Line Wobbler Advance is a demake of Line Wobbler for Game Boy Advance that started as a demo for Synchrony. It contains remakes of the original Line Wobbler levels and adds a challenging advance mode with levels made by various designers.

f1. Wobble at home or on-the-go with Line Wobbler Advance

This project was originally meant to be a port of Line Wobbler and kind of a joke (demaking a game made for even lower level hardware), but once the original levels were complete, a few elements were added, including a timer, different line styles and new core mechanics, such as reactive A.I.

f2. Notes on Line Wobbler

I reverse engineered the game by mapping the LED strip on paper and taking notes on each level. Many elements of the game are perfectly translated, such as enemy and lava positions and speeds and the sizes of the streams. The boss spawns enemies at precisely the same rate in both versions. Thanks in part to this effort, Line Wobbler Advance was awarded first prize in the Wild category at Synchrony.

f3. First prize at Synchrony

Advance mode is a series of levels by different designers implementing their visions of the Line Wobbler universe. This is the part of the game that got the most attention. It turned into a twitchy gauntlet filled with variations on the core mechanics, cinematic interludes and new elements, such as enemies that react to the character's movements. Most of the levels are much harder than the originals and require a lot of retries.

Thanks Robin Baumgarten for giving permission to make custom levels and share this project, and thanks to the advance mode designers Prashast Thapan, Charles Huang, John Rhee, Lillyan Ling, GJ Lee, Emily Koonce, Yuxin Gao, Brian Chung, Paloma Dawkins, Gus Boehling, Dennis Carr, Shuichi Aizawa, Blake Andrews and mushbuh!

You will need an emulator to play. Try Mednafen (Windows/Linux) or Boycott Advance (OS X)

July 19, 2017

f1. BOSS

Games are corrupt dissolutions of nature modeled on prison, ordering a census from the shadows of a vile casino, splintered into shattered glass, pushing symbols, rusted, stale, charred, ultraviolet harbingers of consumption and violence, badges without merit that host a disease of destruction and decay.

You are trapped. You are so trapped your only recourse of action is to imagine an escape route and deny your existence so fully that your dream world becomes the only reality you know. You are fleeing deeper and deeper into a chasm of self-delusion.

While you're dragging your listless, distending corpus from one cell to another, amassing rewards, upgrades, bonuses, achievements, prizes, add-ons and status boosts in rapid succession, stop to think about what's inside the boxes because each one contains a vacuous, soul-sucking nightmare.

Playing can be an awful experience that spirals one into a void of harm and chaos, one so bad it creates a cycle between the greater and lesser systems, each breaking the other's rules. One may succeed by acting in a way that ruins the world.

June 5, 2016
September 30, 2015

Edge of Life is a form I made with Babycastles and Mouth Arcade for an event in New York called Internet Yami-ichi, a flea market of internet-ish goods. We set up our table to look like a doctor's office and pharmacy and offered free examinations and medication prescriptions, a system described by one person as "a whole pharmacy and medical industrial complex".

Diagnoses were based on responses to the form and observations by our doctor during a short examination. The examination typically involved bizarre questions, toy torpedoes being thrown at people and a plastic bucket over the patient's head. The form combined ideas from Myers-Briggs Type Indicators, Codex Seraphinianus and chain-mail personality tests that tell you which TV show character you are. In our waiting room, we had Lake of Roaches installed in a stuffed bat (GIRP bat). It was really fun!

The icons for the food pyramid are from Maple Story and the gun icons are from the dingbat font Outgunned. I'm also using Outgunned to generate the items in Food Spring.

January 28, 2014

☀ E F F L U E N C E ☀

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.

November 9, 2013

Food Spring - Watermelon Stage

Getting the fruit as far as possible is the object of each level, collecting bigger, more valuable guns. The final result is determined by the size of the fruits' collection when the monkey arrives in North America and either survives or perishes in the fruits' attack.

Watermelon Peach
Pineapple Grapes
September 13, 2013

from array import array
from time import sleep

import pygame
from pygame.mixer import Sound, get_init, pre_init

class Note(Sound):

    def __init__(self, frequency, volume=.1):
        self.frequency = frequency
        Sound.__init__(self, self.build_samples())

    def build_samples(self):
        period = int(round(get_init()[0] / self.frequency))
        samples = array("h", [0] * period)
        amplitude = 2 ** (abs(get_init()[1]) - 1) - 1
        for time in xrange(period):
            if time < period / 2:
                samples[time] = amplitude
                samples[time] = -amplitude
        return samples

if __name__ == "__main__":
    pre_init(44100, -16, 1, 1024)

This program generates and plays a 440 Hz tone for 5 seconds. It can be extended to generate the spectrum of notes with a frequency table or the frequency formula. Because the rewards in Send are idealized ocean waves, they can also be represented as tones. Each level has a tone in its goal and a tone based on where the player's disc lands. Both play at the end of a level, sounding harmonic for a close shot and discordant for a near miss. The game can dynamically create these tones using the program as a basis.

I'm also building an algorithmically generated song: Silk Routes (Scissored). Here is an example of how it sounds so far:

August 12, 2013

I've been researching tartan/plaid recently for decoration in my updated version of Ball & Cup, now called Send. I want to create the atmosphere of a sports event, so I plan on drawing tartan patterns at the vertical edges of the screen as backgrounds for areas where spectator ants generate based on player performance. I figured I would make my own patterns, but after browsing tartans available in the official register, I decided to use existing ones instead.

I made a list of the tartans that had what I thought were interesting titles and chose 30 to base the game's levels on. I sequenced them, using their titles to form a loose narrative related to the concept of sending. Here are three tartans in the sequence (levels 6, 7 and 8) generated by an algorithm I inferred by looking at examples that reads a tartan specification and draws its pattern using a simple dithering technique to blend the color stripes.



Spice Apple

It would be wasting an opportunity if I didn't animate the tartans, so I'm thinking about animations for them. One effect I want to try is making them look like water washing over the area where the ants are spectating. I've also recorded some music for the game. Here are the loops for the game over and high scores screens.

Game Over

High Scores

June 29, 2013

A few weeks ago, for Fishing Jam, I made a fishing simulation from what was originally designed to be a time attack arcade game. In the program, Dark Stew, the player controls Aphids, an anthropod who fishes for aquatic creatures living in nine pools of black water.

Fishing means waiting by the pool with the line in. The longer you wait before pulling the line out, the more likely a creature will appear. Aside from walking, it's the only interaction in the game. The creatures are drawings of things you maybe could find underwater in a dream.

The background music is a mix of clips from licensed to share songs on the Free Music Archive. Particularly, Seed64 is an album I used a lot of songs from. The full list of music credits is in the game's README file.

I'm still planning to use the original design in a future version. There would be a reaction-based mini game for catching fish, and the goal would be to catch as many fish as possible within the time limit. I also want to add details and obstacles to the background, which is now a little boring, being a plain, tiled, white floor.

If you want to look at all the drawings or hear the music in the context of the program, there are Windows and source versions available. The source should work on any system with Python and Pygame. If it doesn't, bug reports are much appreciated. Comments are also welcome :)

Dark Stew: Windows, Pygame Source

I wrote in my last post that I would be working on an old prototype about searching a cloud for organisms for Fishing Jam. I decided to wait a while before developing that game, tentatively titled Xenographic Barrier. Its main interactive element is a first-person scope/flashlight, so I'd like to make a Wii version of it.

I'm about to start working on a complete version of Ball & Cup. If I make anything interesting for it, I'll post something. There are a lot of other things I want to write about, like game analyses, my new GP2X and arcades in Korea, and there's still music to release. Lots of fun stuff coming!

May 19, 2013

Welcome! I will be posting here about open-source games and music I am making for free online distribution. Most recently, I made Ball & Cup for Ludum Dare 26, a game I will work on more in June. After finishing, if it's fun, I will build an arcade cabinet for it! Next week, I am joining the 7-Day Fishing Jam to develop an A-life prototype about searching a cloud of noise for organisms.

Before Ball & Cup, I was adding features like vehicle engines, new graphics and effects and detailed scoring to an updated version of E.S.P. Hadouken, currently a prototype about navigating five psychic hadoukens to save your Game Boy. The new version will be similar with a clearer story and more ways to judge your performance. I plan on finishing it after making a public version of Ball & Cup.

I will also upload some digital albums soon. One, Man's Womb, is a solo collection of chiptunes from Emoticon Vs. Rainbow, an online racing/rhythm game. The other, Tor Ghul/Spin Ghul is a guitar and synth record recorded with my friends last summer. The recording and sequencing are finished for both -- I just have to make their web pages and artwork and package them for downloading.

Later, I hope to write about games in their early stages, an abstract action-RPG called Panopticon: Swarm, a massively multiplayer exploration, voting, post-catastrophic city simulation, Vomit Inspector and a mobile mini-game compilation project that includes an external digital pet raising and social networking mode. I also plan to post analyses of games I'm playing as a design exercise and for fun.

I will write about more game stuff like arcade trips, game jams and electronics! Plus whatever I haven't thought of! If you use RSS, subscribe to my feed!