EVR.History.View.Level.Heading = function(cell, level)
{
   this.cell = cell;
   this.level = level;
   this.root = level.view.container.location;
   this.size_relative = level.field;
   this.fill();
}
EVR.History.View.Level.Heading.prototype.fill = function()
{
   var cell = this.cell;
   var id = this.level.id;
   var name = this.get_level_name(id);
   var style = cell.style;
   style.background = this.select_color(id - 1);
   style.fontWeight = HISTORY_LEVEL_NAME_FONT_WEIGHT;
   style.fontStyle = HISTORY_LEVEL_NAME_FONT_STYLE;
   style.letterSpacing = HISTORY_LEVEL_NAME_LETTER_SPACING;
   style.border = HISTORY_LEVEL_NAME_BORDER;
   style.padding = HISTORY_CELL_PADDING;
   var font = HISTORY_FONT;
   var color = HISTORY_LEVEL_NAME_FONT_COLOR;
   var size = HISTORY_LEVEL_NAME_FONT_SIZE;
   this.text = new EVR.Text(cell, name, font, color, size, this.size_relative);
}
EVR.History.View.Level.Heading.prototype.get_level_name = function(level)
{
   var path = this.root + "/view/level/fetch_level_name.php";
   var query = "id=" + level;
   return new EVR.Requester(path, query, true).execute().toUpperCase();
}
EVR.History.View.Level.Heading.prototype.select_color = function(ii)
{
   var palette = HISTORY_HEADING_PALETTE;
   return palette[ii % palette.length];
}
EVR.History.View.Level.Heading.prototype.draw = function()
{
   this.text.set_font_size();
}
EVR.History.View.Level.Heading.prototype.toString = function()
{
   return "[object EVR.History.View.Level.Heading]";
}
EVR.include("history/view/level/Heading.js");
EVR.include("history/view/level/mode/Mode.js");
EVR.History.View.Level = function(view)
{
   this.view = view;
   this.record_index = view.record_index;
   this.field = view.container.container;
   this.records = view.records;
   this.id = view.records[this.record_index].level;
   this.modes = [];
   this.add();
}
EVR.History.View.Level.prototype.add = function()
{
   this.append_heading();
   this.append_mode(HISTORY_TIME_TRIALS_HEADING);
}
EVR.History.View.Level.prototype.append_heading = function()
{
   var view = this.view;
   var row = view.insert_row();
   var cell = view.insert_cell(row);
   cell.colSpan = view.cell_count;
   this.heading = new EVR.History.View.Level.Heading(cell, this);
}
EVR.History.View.Level.prototype.append_mode = function(heading)
{
   var view = this.view;
   this.modes.push(new EVR.History.View.Level.Mode(this, heading));
}
EVR.History.View.Level.prototype.draw = function()
{
   var modes = this.modes;
   this.heading.draw();
   for (var ii = 0; ii < modes.length; ii++)
   {
      modes[ii].draw();
   }
}
EVR.History.View.Level.prototype.toString = function()
{
   return "[object EVR.History.View.Level]";
}
<?php
define("PATH", "../../../../../../../users/level_ids");
$levels = file(PATH, FILE_IGNORE_NEW_LINES);
$id = $_GET["id"] - 1;
$fields = explode("|", $levels[$id]);
echo $fields[1];
EVR.History.View.Level.Mode.Separator = function(row, count)
{
   this.row = row;
   this.count = count;
   this.add();
}
EVR.History.View.Level.Mode.Separator.prototype.add = function()
{
   var cell, style, row = this.row;
   for (var ii = 0; ii < this.count; ii++)
   {
      cell = row.insertCell(-1);
      style = cell.style;
      style.border = HISTORY_SEPARATOR_BORDER;
      style.background = this.select_color(ii);
      style.padding = HISTORY_CELL_PADDING + " 0";
      style.fontSize = "0px";
      cell.innerHTML = "&nbsp;";
   }
}
EVR.History.View.Level.Mode.Separator.prototype.select_color = function(ii)
{
   var palette = HISTORY_SEPARATOR_PALETTE;
   return palette[ii % palette.length];
}
EVR.History.View.Level.Mode.Separator.prototype.toString = function()
{
   return "[object EVR.History.View.Level.Mode.Separator]";
}
EVR.include("history/view/level/mode/Separator.js");
EVR.include("history/view/level/mode/Time.js");
EVR.History.View.Level.Mode = function(level, heading)
{
   this.level = level;
   this.view = level.view;
   this.heading = heading;
   this.cell_count = level.view.cell_count;
   this.size_relative = level.field;
   this.record_index = level.record_index;
   this.times = [];
   this.fill();
}
EVR.History.View.Level.Mode.prototype.fill = function()
{
   this.append_separator();
   this.append_heading();
   this.append_separator();
   this.append_times();
}
EVR.History.View.Level.Mode.prototype.append_separator = function()
{
   var row = this.view.insert_row();
   new EVR.History.View.Level.Mode.Separator(row, this.cell_count);
}
EVR.History.View.Level.Mode.prototype.append_heading = function()
{
   var row = this.view.insert_row();
   var cell = row.insertCell(-1);
   var style = cell.style;
   cell.colSpan = this.cell_count;
   style.fontStyle = HISTORY_MODE_FONT_STYLE;
   style.letterSpacing = HISTORY_MODE_LETTER_SPACING;
   style.padding = 0;
   var size = HISTORY_MODE_FONT_SIZE;
   var font = HISTORY_FONT;
   var text = this.heading;
   this.text = new EVR.Text(cell, text, font, null, size, this.size_relative);
}
EVR.History.View.Level.Mode.prototype.append_times = function()
{
   var view = this.view;
   var records = view.records;
   var rows = this.add_rows();
   var row, record, time;
   for (var ii = 0; ii < HISTORY_RECORD_LIMIT; ii++)
   {
      if (ii < 3)
      {
	 row = rows[ii];
      }
      else
      {
	 row = rows[ii % 3 + 3];
	 if (ii > 5)
	 {
	    row.insertCell(-1).colSpan = 2;
	 }
      }
      time = null;
      if (this.record_index < records.length)
      {
	 record = records[this.record_index];
	 if (record.level == this.level.id)
	 {
	    time = record.time;
	 }
      }
      this.times.push(
	 new EVR.History.View.Level.Mode.Time(
	    row, time, ii, this.size_relative));
      this.record_index++;
   }
}
EVR.History.View.Level.Mode.prototype.add_rows = function()
{
   var view = this.view;
   var rows = [];
   for (var ii = 0; ii < 6; ii++)
   {
      rows.push(view.insert_row());
   }
   return rows;
}
EVR.History.View.Level.Mode.prototype.draw = function()
{
   this.text.set_font_size();
   var times = this.times;
   for (var ii = 0; ii < times.length; ii++)
   {
      times[ii].draw();
   }
}
EVR.History.View.Level.Mode.prototype.toString = function()
{
   return "[object EVR.History.View.Level.Mode]";
}
216.73.216.129
216.73.216.129
216.73.216.129
 
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