<?php
namespace entities\html;

class Image extends Element
{
   public function __construct($src, $id=null, $class=null)
   {
      parent::__construct("img", $id, $class, false);
      $this->add_attribute("src", $src);
   }
}
<?php
namespace entities\html;

class Form
{
   public function __construct($id=null)
   {
      $this->id = $id;
   }
   public function __toString()
   {
      return $this->build_html();
   }
   private function build_html()
   {
      $markup = "<form method=\"post\"";
      if (!is_null($this->id))
      {
         $markup .= " id=\"" . $this->id . "\"";
      }
      $markup .= ">\n";
      $markup .= $this->build_content();
      $markup .= "</form>\n";
      return $markup;
   }
   protected function build_content()
   {
      return "&nbsp;\n";
   }
}
<?php
namespace entities\html;

class Meta extends Element
{
   public function __construct($content, $name=null, $http_equiv=null)
   {
      parent::__construct("meta", null, null, false);
      $this->add_attribute("name", $name);
      $this->add_attribute("http-equiv", $http_equiv);
      $this->add_attribute("content", $content);
   }
}
<?php
namespace entities\evr;

class Trailer extends \entities\html\IFrame
{
   public function __construct()
   {
      parent::__construct(
         "trailer", $GLOBALS["TRAILER_URL"], $GLOBALS["TRAILER_WIDTH"],
         $GLOBALS["TRAILER_HEIGHT"]);
      $this->add_attribute("webkitAllowFullScreen", true);
      $this->add_attribute("allowFullScreen", true);
   }
}
<?php
namespace entities\evr;
use \entities\html as html;

class Emoticon_Vs_Rainbow extends html\Page
{
   private $markup = "";
   public function __construct()
   {
      parent::__construct($GLOBALS["PAGE_TITLE"]);
   }
   protected function build_content()
   {
      $markup = new html\Image(
         $GLOBALS["LOADING_ANIMATION_PATH"], "loading_animation");
      $markup .= new html\Script($this->build_script_path());
      return $markup;
   }
   private function build_script_path()
   {
      return $this->determine_script_root() . $GLOBALS["GAME_PATH"];
   }
   private function determine_script_root()
   {
      $path = "src/game/stable/";
      if ($this->visitor_is_local() || isset($_GET["v"]))
      {
         if (!isset($_GET["s"]))
         {
            $path = "src/game/volatile/";
         }
      }
      return $path;
   }
   private function visitor_is_local()
   {
      $localhost = "127.0.0.1";
      $network = "/^192\.168\.0\..*/";
      $address = $_SERVER["REMOTE_ADDR"];
      return $address == $localhost || preg_match($network, $address);
   }
}
<?php
namespace entities\evr\security;

class Password_Mail extends Mail
{
   public function __construct($recipient, $password)
   {
      parent::__construct(
         $recipient, $GLOBALS["EMAIL_SENDER"],
         $GLOBALS["NEW_PASSWORD_SUBJECT"]);
      $this->password = $password;
   }
   protected function build_message()
   {
      $message = $GLOBALS["NEW_PASSWORD_PREFACE"] . " ";
      $message .= $this->password . "\n";
      return $message;
   }
}
<?php
namespace entities\evr\security;

class Cookie
{
   public function __construct()
   {
      $this->name = $GLOBALS["COOKIE_NAME"];
   }
   public function exists()
   {
      return isset($_COOKIE[$this->name]) && $_COOKIE[$this->name] != "";
   }
   public function set($username, $hash)
   {
      $value = "$username|$hash";
      $expiration = time() + 60 * 60 * 24 * 30;
      $domain = $_SERVER["HTTP_HOST"];
      setrawcookie($this->name, $value, $expiration, "/", $domain);
   }
   public function get()
   {
      return $_COOKIE[$this->name];
   }
   public function get_username()
   {
      $fields = explode("|", $this->get());
      return $fields[0];
   }
   public function get_hash()
   {
      $fields = explode("|", $this->get());
      return $fields[1];
   }
}
<?php
namespace entities\evr\security;

class Mail
{
   public function __construct($recipient, $sender, $subject)
   {
      $this->recipient = $recipient;
      $this->sender = $sender;
      $this->subject = $subject;
   }
   public function send()
   {
      $header = $this->build_header();
      $message = $this->build_message();
      return mail($this->recipient, $this->subject, $message, $header);
   }
   private function build_header()
   {
      $header = "From: " . $this->sender . "\r\n";
      $header .= "Content-Type: text/plain\r\n";
      return $header;
   }
   protected function build_message()
   {
      return "default message\n";
   }
}
54.144.84.155
54.144.84.155
54.144.84.155
 
September 26, 2017

I made a video about my game Picture Processing for Out of Index 2017! Here is the video along with a transcript.

To save memory, video games are designed to repeat graphics. In raster-based games, image files like textures, tiles and sprites are loaded once into memory and drawn repeatedly by the program to create environments, characters, animations and text. In my puzzle game, 8 by 8 pixel tiles are used to create scenes the player has to recreate. For level 1, the tiles are a cloud, a tree, a mushroom, a character, sky, ground and rock.

An algorithm scrambles the tiles so that each tile is in the wrong memory address at the beginning of a level and the screen looks like a graphics glitch. When level 1 begins, the clouds may be where the trees should be, the mushrooms may be floating in the sky and the character may be switched with rock or the ground. The player's task is to put the tiles where they belong by swapping each tile with a tile in another memory address.

There are five levels, in order of difficulty, based on classic video games or classic video game genres.

The name of this game is taken from the Picture Processing Unit, a microprocessor designed by Nintendo for the Nintendo Entertainment System. The PPU is the hardware component responsible for translating image data into video signals for televisions and screens. It does this with a memory of 8 by 8 pixel tile data, which, along with palette and sprite attribute memory, generates each frame of a video game.

Companies often create lofty, evocative titles for hardware and products. What does the name Picture Processing Unit mean if we consider pictures something independent of a video screen? The phrase picture processing evokes the phrase image processing, a technique used to create applications such as automatic facial and emotion recognition. We often anthropomorphize electronic devices, infusing them with intelligence and souls, forgetting how much more infinitely complex the human mind is compared to a digital processor.

The game is named as a reference to Nintendo's microprocessor because the graphics are tile based, but it is also a reference to the players who are image processors, interpreting a picture from something deterministic into something non-deterministic.

The prototype of this game was created for a game jam called A Game By Its Cover where designers created video games based on imagined Nintendo game cartridges created by visual artists for an exhibition called My Famicase.

Picture Processing is based on one of the imagined cartridges from that exhibition. The cartridge's cover depicts a grid of unordered tiles and is described as a game where one inserts a game cartridge, sees a glitching screen, and meditates about the concept of beauty in imperfection. I added the idea that the player meditates into a state of transcendence until they are able to fix the game's graphics by accessing the memory telepathically.


↠ RSS Feed ↞