<?php
namespace entities\evr\security;

class Key_Hashes
{
   public function __construct()
   {
      $this->set_path();
      $this->set_hashes();
   }
   private function set_path()
   {
      $this->path = $GLOBALS["KEY_HASHES_PATH"];
   }
   private function set_hashes()
   {
      $this->hashes = file($this->path, FILE_IGNORE_NEW_LINES);
   }
   public function write()
   {
      $string = implode("\n", $this->hashes) . "\n";
      file_put_contents($this->path, $string);
   }
   public function remove($hash)
   {
      $hashes = $this->hashes;
      foreach (range(0, count($hashes) - 1) as $ii)
      {
         if ($hashes[$ii] == $hash)
         {
            array_splice($hashes, $ii, 1);
            break;
         }
      }
      $this->hashes = $hashes;
   }
}
<?php
namespace entities\evr\security;
use entities\html as html;

class Security
{
   public function __construct()
   {
      $this->registrar = new Registrar();
      $this->cookie = new Cookie();
      $this->set_username();
      $this->addresses = new Addresses($this->username);
   }
   private function set_username()
   {
      $username = null;
      if ($this->is_login())
      {
         $submission = $this->get_post_parameter("username");
         $username = $this->find_user_directory($submission);
      }
      else if ($this->cookie->exists())
      {
         $username = $this->cookie->get_username();
      }
      $this->username = $username;
   }
   private function is_login()
   {
      $action = $this->get_post_parameter("action");
      return $action == $GLOBALS["LOGIN_BUTTON_TEXT"];
   }
   public function register_user()
   {
      return $this->registrar->register();
   }
   public static function validate_key()
   {
      $hashes = new Key_Hashes();
      $key = self::get_post_parameter("key");
      if (self::find_hash($hashes, $key))
      {
         return true;
      }
      self::show_error("Key not found");
      return false;
   }
   public static function find_hash($hashes, $key)
   {
      foreach ($hashes->hashes as $hash)
      {
         if (self::match_to_hash($key, $hash))
         {
            return $hash;
         }
      }
   }
   public static function match_to_hash($key, $hash)
   {
      if (!$hash)
      {
         return $hash == crypt($key);
      }
      return $hash == crypt($key, $hash);
   }
   public static function show_error($message)
   {
      echo new html\Div(null, "error", $message);
   }
   public function validate_user()
   {
      $action = $this->get_post_parameter("action");
      if ($this->is_login())
      {
         return $this->log_user_in();
      }
      else if ($this->cookie->exists())
      {
         return $this->validate_cookie();
      }
   }
   public static function get_post_parameter($name)
   {
      if (isset($_POST[$name]))
      {
         return $_POST[$name];
      }
   }
   private function log_user_in()
   {
      $password = $this->get_post_parameter("password");
      if ($hash = $this->verify_credentials($this->username, $password))
      {
         if ($this->get_post_parameter("remember"))
         {
            $this->cookie->set($this->username, $hash);
            $this->addresses->add_current();
         }
         return true;
      }
      return false;
   }
   public static function verify_credentials($username, $password)
   {
      $hash = self::get_stored_hash($username);
      if (self::match_to_hash($password, $hash))
      {
         return $hash;
      }
      self::show_error("Username/password not found");
   }
   public static function get_stored_hash($username)
   {
      $root = $GLOBALS["USERS_PATH"] . "/";
      $path = "$root$username/" . $GLOBALS["USER_HASH_PATH"];
      if (is_file($path))
      {
         return trim(file_get_contents($path));
      }
      return null;
   }
   public static function find_user_directory($username)
   {
      $root = $GLOBALS["USERS_PATH"];
      foreach (scandir($root) as $file_name)
      {
         $path = "$root/$file_name";
         if (is_dir($path) && !strcasecmp($file_name, $username))
         {
            return $file_name;
         }
      }
   }
   private function validate_cookie()
   {
      $hash = $this->cookie->get_hash();
      $stored = self::get_stored_hash($this->username);
      if ($hash == $stored)
      {
         if ($this->addresses->find_current_address())
         {
            $this->cookie->set($this->username, $hash);
            return true;
         }
      }
      return false;
   }
   public static function show_success($message)
   {
      echo new html\Div(null, "success", $message);
   }
   public static function remove_key()
   {
      $key = self::get_post_parameter("key");
      $hashes = new Key_Hashes();
      $hash = self::find_hash($hashes, $key);
      $hashes->remove($hash);
      $hashes->write();
   }
   public function change_password()
   {
      return $this->registrar->change_password();
   }
   public function reset_password()
   {
      return $this->registrar->reset_password();
   }
}
34.239.167.149
34.239.167.149
34.239.167.149
 
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)