EVR.Level.Delegate = function(level)
{
   this.level = level;
   this.evr = level.evr;
   this.prompt = level.prompt;
   this.countdown = level.countdown;
   this.racer = level.road.racer;
   this.path = level.road.path;
}
EVR.Level.Delegate.prototype.enter = function()
{
   var level = this.level;
   var prompt = this.prompt;
   if (level.states[LEVEL_STATE_WAITING])
   {
      prompt.remove();
      this.countdown.start();
      prompt.set_text(LEVEL_PAUSE_PROMPT_TEXT);
   }
   else if (level.states[LEVEL_STATE_RACING])
   {
      level.pause();
   }
   else if (level.states[LEVEL_STATE_SUMMARIZING])
   {
      level.show_records();
   }
   else if (level.states[LEVEL_STATE_FINISHED])
   {
      prompt.set_finish_text();
      prompt.toggle();
   }
}
EVR.Level.Delegate.prototype.up = function()
{
   if (this.path.playing)
   {
      this.racer.move(-1);
   }
}
EVR.Level.Delegate.prototype.down = function()
{
   if (this.path.playing)
   {
      this.racer.move(1);
   }
}
EVR.Level.Delegate.prototype.sprint = function()
{
   this.path.sprint();
}
EVR.Level.Delegate.prototype.cancel_sprint = function()
{
   this.path.sprinting = false;
}
EVR.Level.Delegate.prototype.restart = function()
{
   var level = this.level;
   if (level.states[LEVEL_STATE_PAUSED] || level.states[LEVEL_STATE_FINISHED])
   {
      this.evr.load_level(level.id, level.practice);
   }
}
EVR.Level.Delegate.prototype.main_menu = function()
{
   var level = this.level;
   if (level.states[LEVEL_STATE_PAUSED] || level.states[LEVEL_STATE_FINISHED])
   {
      this.evr.unload_level();
   }
}
EVR.Level.Delegate.prototype.next_level = function()
{
   var level = this.level;
   if (level.states[LEVEL_STATE_FINISHED])
   {
      var id = parseInt(level.id);
      var evr = this.evr;
      if (level.next_level_is_available())
      {
	 evr.load_level(id + 1);
      }
      else if (id == LEVEL_LIMIT && level.is_clear())
      {
	 evr.load_ending();
      }
   }
}
EVR.Level.Delegate.prototype.toString = function()
{
   return "[object EVR.Level.Delegate]";
}
EVR.Level.Clock = function(level)
{
   EVR.Graphic.call(
      this, level.road, null, null, ALIGN_RIGHT, level.road.container);
   this.road = level.road;
   this.height = CLOCK_HEIGHT;
   this.build();
   this.append();
}
EVR.Level.Clock.prototype = new EVR.Graphic;
EVR.Level.Clock.prototype.build = function()
{
   this.set_proportions(CLOCK_WIDTH, this.height);
   this.set_opacity(CLOCK_OPACITY);
   this.set_color(CLOCK_BACKGROUND);
   this.set_text("00:00.000", CLOCK_FONT, CLOCK_TEXT_COLOR, CLOCK_TEXT_SIZE);
   this.css.fontWeight = CLOCK_FONT_WEIGHT;
   this.css.letterSpacing = CLOCK_LETTER_SPACING;
   this.set_line_height();
   this.css.overflow = "hidden";
   this.time = new EVR.Time();
}
EVR.Level.Clock.prototype.set_line_height = function()
{
   this.css.lineHeight = this.get_dimensions()[1] + "px";
}
EVR.Level.Clock.prototype.start = function()
{
   var current = this;
   this.timestamp = +new Date;
   this.interval = window.setInterval(
      function() {
	 current.measure();
      }, CLOCK_INTERVAL);
}
EVR.Level.Clock.prototype.measure = function()
{
   var timestamp = +new Date;
   var difference = timestamp - this.timestamp;
   this.time.add(difference);
   this.timestamp = timestamp;
   this.text.set(this.time.get_formatted());
}
EVR.Level.Clock.prototype.stop = function()
{
   if (!!this.interval)
   {
      window.clearInterval(this.interval);
      this.interval = null;
      this.measure();
   }
}
EVR.Level.Clock.prototype.toggle = function()
{
   if (!!!this.interval)
   {
      this.start();
   }
   else
   {
      this.stop();
   }
}
EVR.Level.Clock.prototype.place = function()
{
   EVR.Graphic.prototype.place.call(this);
   var y = this.road.borders.get_dimensions()[1];
   y += this.road.get_dimensions()[1];
   this.set_coordinates([null, y])
}
EVR.Level.Clock.prototype.draw = function()
{
   EVR.Graphic.prototype.draw.call(this);
   this.set_line_height();
}
EVR.Level.Clock.prototype.toString = function()
{
   return "[object EVR.Level.Clock]";
}
<?php
require_once "../account/get_user_path.php";
$GLOBALS["PROGRESS_FILE_NAME"] = "progress";
$path = account\get_user_path() . $GLOBALS["PROGRESS_FILE_NAME"];
$progress = trim(file_get_contents($path));
if (isset($_GET["clear"]) && $_GET["clear"] > $progress)
{
   $progress++;
   file_put_contents($path, $progress);
}
echo $progress;
<?php
require_once "../account/get_user_path.php";
$GLOBALS["FILE_NAME"] = "expert";
add_id_to_list();
function add_id_to_list()
{
   $id = $_GET["id"];
   $levels = get_list();
   if (!in_array($id, $levels))
   {
      $levels[] = $id;
   }
   file_put_contents(build_path(), implode(" ", $levels));
}
function get_list()
{
   $raw = file_get_contents(build_path());
   if ($raw == "")
   {
      return array();
   }
   return explode(" ", $raw);
}
function build_path()
{
   return account\get_user_path() . $GLOBALS["FILE_NAME"];
}
54.80.81.223
54.80.81.223
54.80.81.223
 
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


↠ RSS Feed ↞