from xenographic_wall.pgfw.Configuration import TypeDeclarations
from xenographic_wall.pgfw.Game import Game
from xenographic_wall.Introduction import Introduction
from xenographic_wall.world.World import World

class XenographicWall(Game):

    def __init__(self):
        Game.__init__(self, type_declarations=Types())
        self.introduction.activate()

    def set_children(self):
        Game.set_children(self)
        self.introduction = Introduction(self)
        self.world = World(self)

    def update(self):
        self.introduction.update()
        self.world.update()


class Types(TypeDeclarations):

    additional_defaults = \
        {"intro": \
         {"path": ["mask", "cord", "starfield", "sunburst"],
          "int": ["frame-duration", "starfield-max-alpha",
                  "prompt-visible-frames", "reset-delay"],
          "int-list": ["cord-y-range", "zoom-upper-left",
                       "zoom-region-dimensions"],
          "float": ["cord-speed", "zoom-step-ratio", "sunburst-delay",
                    "zoom-delay", "starfield-fade-step"]},
         "scope": \
         {"int": ["diameter", "ring-count", "flash-length"],
          "list": ["colors", "flash-colors"],
          "float": ["glow-step"]},
         "world": \
         {"path": "audio",
          "int-list": ["dimensions", "frame-border", "scroll-speed"]},
         "mushrooms": \
         {"int": "count", "list": "images", "path": "path"},
         "creature": \
         {"path": "root"}}
from pygame import mouse, Color, Surface, Rect

from xenographic_wall.pgfw.GameChild import GameChild
from xenographic_wall.world.scope.Scope import Scope
from xenographic_wall.world.mushrooms.Mushrooms import Mushrooms
from xenographic_wall.creatures.Creatures import Creatures

class World(GameChild, Surface):

    def __init__(self, parent):
        GameChild.__init__(self, parent)
        self.init_surface()
        self.deactivate()
        self.initialize_clip()
        self.scope = Scope(self)
        self.mushrooms = Mushrooms(self)
        self.set_frame()
        self.subscribe_to(self.get_custom_event_id(), self.respond_to_event)
        self.creatures = Creatures(self)
        self.reset()

    def init_surface(self):
        size = self.get_configuration().get("world", "dimensions")
        Surface.__init__(self, size)

    def deactivate(self):
        self.active = False

    def respond_to_event(self, evt):
        if self.is_command(evt, "cancel-introduction"):
            self.activate()
        elif self.is_command(evt, "reset-game"):
            self.reset()

    def activate(self):
        self.active = True
        self.scope.activate()
        self.get_audio().play_bgm(self.get_resource("world", "audio"))
        mouse.set_pos(self.get_screen().get_rect().center)

    def get_mouse_pos(self):
        pos = mouse.get_pos()
        clip = self.get_clip()
        return pos[0] + clip.left, pos[1] + clip.top

    def initialize_clip(self):
        clip = Rect((0, 0), self.get_screen().get_size())
        clip.center = self.get_rect().center
        self.set_clip(clip)

    def set_frame(self):
        border = self.get_configuration("world", "frame-border")
        screen = self.get_screen()
        frame = Rect((0, 0), screen.get_size())
        frame.w -= border[0]
        frame.h -= border[1]
        frame.center = screen.get_rect().center
        self.frame = frame

    def reset(self):
        self.deactivate()
        self.scope.reset()
        self.initialize_clip()
        self.creatures.reset()

    def update(self):
        if self.active:
            self.clear()
            self.update_clip()
            self.scope.update()
            self.mushrooms.update()
            self.creatures.update()
            self.draw()

    def clear(self):
        self.fill(Color("black"))

    def update_clip(self):
        x, y = mouse.get_pos()
        frame = self.frame
        move = self.move_clip
        dx, dy = 0, 0
        if not frame.collidepoint((x, y)):
            if y < frame.top:
                dy = y - frame.top
            elif y > frame.bottom:
                dy = y - frame.bottom
            if x < frame.left:
                dx = x - frame.left
            elif x > frame.right:
                dx = x - frame.right
            mx, my = self.get_configuration("world", "scroll-speed")
            move(dx / mx, dy / my)

    def move_clip(self, x=0, y=0):
        clip = self.get_clip()
        bound = self.get_rect()
        original_center = clip.center
        clip.top += y
        if clip.top < bound.top:
            clip.top = bound.top
        elif clip.bottom > bound.bottom:
            clip.bottom = bound.bottom
        clip.left += x
        if clip.left < bound.left:
            clip.left = bound.left
        elif clip.right > bound.right:
            clip.right = bound.right
        self.set_clip(clip)
        new_center = clip.center
        return new_center[0] - original_center[0], \
               new_center[1] - original_center[1]

    def draw(self):
        screen = self.get_screen()
        screen.blit(self, (0, 0), self.get_clip())
from random import randrange

from pygame import Surface, Color, Rect

from xenographic_wall.pgfw.GameChild import GameChild

class Mushroom(GameChild, Surface):

    transparent_color = Color("magenta")

    def __init__(self, parent, group, images):
        GameChild.__init__(self, parent)
        self.group = group
        self.images = images
        self.init_surface()
        self.place()
        self.eaten = False
        self.bitten = False

    def init_surface(self):
        image = self.images[0]
        Surface.__init__(self, image.get_size())
        self.clear()
        self.set_colorkey(self.transparent_color)
        self.blit(image, (0, 0))

    def clear(self):
        self.fill(self.transparent_color)

    def place(self):
        world = self.parent.parent
        size = self.get_size()
        x_bound = world.get_width() - size[0]
        y_bound = world.get_height() - size[1]
        self.rect = Rect((randrange(0, x_bound), randrange(0, y_bound)), size)

    def eat(self):
        self.eaten = True

    def bite(self):
        self.clear()
        self.blit(self.images[1], (0, 0))
        self.bitten = True
        sound = self.get_configuration("mushrooms", "bite-sound")
        self.get_audio().play_fx(sound, self.get_x_ratio())

    def get_x_ratio(self):
        return float(self.rect.centerx) / self.parent.parent.get_width()
        
    def update(self):
        self.draw()

    def draw(self):
        self.parent.parent.blit(self, self.rect)
216.73.216.155
216.73.216.155
216.73.216.155
 
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!

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