<?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();
   }
}
18.97.9.173
18.97.9.173
18.97.9.173
 
August 12, 2013

I've been researching tartan/plaid recently for decoration in my updated version of Ball & Cup, now called Send. I want to create the atmosphere of a sports event, so I plan on drawing tartan patterns at the vertical edges of the screen as backgrounds for areas where spectator ants generate based on player performance. I figured I would make my own patterns, but after browsing tartans available in the official register, I decided to use existing ones instead.

I made a list of the tartans that had what I thought were interesting titles and chose 30 to base the game's levels on. I sequenced them, using their titles to form a loose narrative related to the concept of sending. Here are three tartans in the sequence (levels 6, 7 and 8) generated by an algorithm I inferred by looking at examples that reads a tartan specification and draws its pattern using a simple dithering technique to blend the color stripes.


Acadia


Eve


Spice Apple

It would be wasting an opportunity if I didn't animate the tartans, so I'm thinking about animations for them. One effect I want to try is making them look like water washing over the area where the ants are spectating. I've also recorded some music for the game. Here are the loops for the game over and high scores screens.

Game Over

High Scores