<?php
namespace structures\html;
class Script extends Element
{
   public function __construct($src=null)
   {
      parent::__construct("script");
      $this->add_attribute("src", $src);
   }
}
<?php
namespace structures\html;

class Head extends Element
{
   public function __construct(
      $title=null, $css_path=null, $description=null, $favicon_path=null,
      $thumbnail_path=null)
   {
      parent::__construct("head");
      $this->title = $title;
      $this->css_path = $css_path;
      $this->description = $description;
      $this->favicon_path = $favicon_path;
      $this->thumbnail_path = $thumbnail_path;
   }
   protected function build_content()
   {
      $markup = $this->build_title();
      $markup .= $this->build_css_link();
      $markup .= $this->build_description();
      $markup .= $this->build_favicon_link();
      $markup .= $this->build_thumbnail_link();
      return $markup;
   }
   protected function build_title()
   {
      $title = $this->title;
      if (!is_null($title))
      {
         return new Title($this->title);
      }
      return null;
   }
   protected function build_css_link()
   {
      $path = $this->css_path;
      if (!is_null($path))
      {
         return new Link("stylesheet", $path);
      }
      return null;
   }
   protected function build_description()
   {
      $description = $this->description;
      if (!is_null($description))
      {
         return new Meta($description, "description");
      }
      return null;
   }
   protected function build_favicon_link()
   {
      $path = $this->favicon_path;
      if (!is_null($path))
      {
         return new Link("shortcut icon", $path);
      }
      return null;
   }
   protected function build_thumbnail_link()
   {
      $path = $this->thumbnail_path;
      if (!is_null($path))
      {
         return new Link("image_src", $path);
      }
      return null;
   }
}
<?php
namespace structures\html;

class Table extends Element
{
   public function __construct($id=null, $class=null, $cellspacing=0)
   {
      parent::__construct("table", $id, $class);
      $this->add_attribute("cellspacing", $cellspacing);
   }
}
<?php
namespace structures\html;

class A extends Element
{
   public function __construct($href=null, $content=null, $id=null, $class=null)
   {
      parent::__construct("a", $id, $class);
      $this->add_attribute("href", $href);
      $this->content = $content;
   }

   protected function build_content()
   {
      $content = $this->content;
      if (is_null($content))
      {
         $content = $this->get_attribute("href");
      }
      return $content;
   }
}
<?php
namespace structures\html;

class HTML extends Element
{
   public function __construct(
      $title=null, $css_path=null, $description=null, $favicon_path=null,
      $thumbnail_path=null)
   {
      parent::__construct("html");
      $this->title = $this->get_default($title, "PAGE_TITLE");
      $this->css_path = $this->get_default($css_path, "CSS_PATH");
      $this->description = $description;
      $this->favicon_path = $favicon_path;
      $this->thumbnail_path = $thumbnail_path;
   }
   protected function build_content()
   {
      $markup = $this->build_head();
      $markup .= new Body($this->build_body());
      return $markup;
   }
   protected function build_head()
   {
      return new Head(
         $this->title, $this->css_path, $this->description,
         $this->favicon_path, $this->thumbnail_path);
   }
   protected function build_body()
   {
      return null;
   }
}
<?php
namespace structures\html;

class Td extends Element
{
   public function __construct(
      $content=null, $id=null, $class=null, $colspan=null, $rowspan=null)
   {
      parent::__construct("td", $id, $class);
      $this->content = $content;
      $this->add_attribute("colspan", $colspan);
      $this->add_attribute("rowspan", $rowspan);
   }
   protected function build_content()
   {
      return $this->content;
   }
}
<?php
namespace structures\html;

class IFrame extends Element
{
   public function __construct($id, $src, $width, $height)
   {
      parent::__construct("iframe", $id);
      $this->add_attribute("src", $src);
      $this->add_attribute("width", $width);
      $this->add_attribute("height", $height);
      $this->add_attribute("frameborder", "0");
   }
}
<?php
namespace structures\html;

class Body extends Element
{
   public function __construct($content)
   {
      parent::__construct("body");
      $this->content = $content;
   }
   protected function build_content()
   {
      return $this->content . $this->break_line();
   }
}
13.58.152.136
13.58.152.136
13.58.152.136
 
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!