import pygame

class Animation:

    def __init__(self, frame_duration):
        self.reset_ticks()
        self.updates_this_cycle = 1
        self.overflow = 0
        self.update_count = 1
        self.actual_frame_duration = 0
        self.target_frame_duration = frame_duration
        self.stopping = False

    def reset_ticks(self):
        self.last_ticks = self.get_ticks()

    def play(self):
        while not self.stopping:
            self.advance_frame()
            self.update_frame_duration()
            self.update_overflow()
        self.stopping = False

    def advance_frame(self):
        while self.update_count > 0:
            self.sequence()
            self.update_count -= 1

    def update_frame_duration(self):
        last_ticks = self.last_ticks
        actual_frame_duration = self.get_ticks() - last_ticks
        last_ticks = self.get_ticks()
        wait_duration = self.get_configuration()["display-wait-duration"]
        while actual_frame_duration < self.target_frame_duration:
            pygame.time.wait(wait_duration)
            actual_frame_duration += self.get_ticks() - last_ticks
            last_ticks = self.get_ticks()
        self.actual_frame_duration = actual_frame_duration
        self.last_ticks = last_ticks

    def get_ticks(self):
        return pygame.time.get_ticks()

    def update_overflow(self):
        self.update_count = 1
        target_frame_duration = self.target_frame_duration
        overflow = self.overflow
        overflow += self.actual_frame_duration - target_frame_duration
        while overflow > target_frame_duration:
            self.update_count += 1
            overflow -= target_frame_duration
        overflow = self.overflow

    def stop(self):
        self.stopping = True

    def clear_queue(self):
        self.update_count = 1
from pygame import event
from pygame.locals import *

from GameChild import *

class EventDelegate(GameChild):

    command_event = USEREVENT
    state_change_event = USEREVENT + 1

    def __init__(self, game):
        GameChild.__init__(self, game)
        self.subscribers = dict()
        self.disable()

    def enable(self):
        self.enabled = True

    def disable(self):
        self.enabled = False

    def dispatch_events(self):
        if self.enabled:
            subscribers = self.subscribers
            for evt in event.get():
                kind = evt.type
                if kind in subscribers:
                    for subscriber in subscribers[kind]:
                        subscriber(evt)
        else:
            event.pump()

    def add_subscriber(self, kind, callback):
        subscribers = self.subscribers
        if kind not in subscribers:
            subscribers[kind] = list()
        subscribers[kind].append(callback)

    @classmethod
    def post_event(self, id, **kw):
        event.post(event.Event(id, **kw))
import sys

import pygame
from pygame.locals import *

from GameChild import *
from Animation import *
from Audio import *
from Display import *
from configuration.Configuration import *
from EventDelegate import *
from Input import *
from ScreenGrabber import *
from introduction.Introduction import *
from world.World import *

class Game(GameChild, Animation):
    
    def __init__(self):
        GameChild.__init__(self)
        self.configuration = Configuration()
        Animation.__init__(self, self.configuration["display-frame-duration"])
        pygame.init()
        self.add_children()
        self.subscribe_to_events()
        self.clear_queue()
        self.delegate.enable()
        self.introduction.activate()

    def add_children(self):
        self.audio = Audio(self)
        self.display = Display(self)
        self.delegate = EventDelegate(self)
        self.input = Input(self)
        self.screen_grabber = ScreenGrabber(self)
        self.introduction = Introduction(self)
        self.world = World(self)

    def subscribe_to_events(self):
        self.subscribe_to(QUIT, self.end)
        self.subscribe_to(Input.command_event, self.end)

    def get_configuration(self):
        return self.configuration

    def get_input(self):
        return self.input

    def sequence(self):
        self.delegate.dispatch_events()
        self.world.update()
        pygame.display.update()

    def end(self, evt):
        if evt.type == QUIT or evt.command == "quit":
            sys.exit()
from pygame.mixer import Channel, Sound, music

from GameChild import *

class Audio(GameChild):

    def __init__(self, game):
        GameChild.__init__(self, game)
        self.set_channels()

    def set_channels(self):
        config = self.get_configuration()
        self.bg_channel = Channel(config["audio-bg-channel"])

    def play_bgm(self, path, stream=False):
        if stream:
            self.bg_channel.stop()
            music.load(path)
            music.play(-1)
        else:
            music.stop()
            self.bg_channel.play(Sound(path), -1)
from transistors.GameChild import *
from slides.Slides import *

from transistors.EventDelegate import *

class Introduction(GameChild):

    def __init__(self, parent):
        GameChild.__init__(self, parent)
        self.slides = Slides(self)
        self.subscribe_to_events()

    def subscribe_to_events(self):
        self.subscribe_to(EventDelegate.command_event, self.advance)

    def reset(self):
        self.slides.reset()

    def activate(self):
        self.active = True
        self.set_music()
        self.draw()

    def deactivate(self):
        self.active = False

    def set_music(self):
        self.get_audio().play_bgm(self.get_resource("introduction-music-path"))

    def advance(self, evt):
        if self.active and evt.command == "release":
            if self.slides.advance():
                self.draw()
            else:
                self.deactivate()
                EventDelegate.post_event(EventDelegate.state_change_event,
                                         state="introduction-finished")

    def draw(self):
        self.slides.draw()
216.73.216.60
216.73.216.60
216.73.216.60
 
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)