EVR.include("animation/effects/Scroller.js");
EVR.include("animation/effects/Fader.js");
EVR.include("animation/introduction/Introduction.js");
EVR.include("animation/ending/Ending.js");

EVR.Animation = function(rate, skip_frames, buffer)
{
   this.rate = rate;
   this.playing = false;
   this.deviation = 0;
   this.skip_frames = skip_frames || false;
   this.buffer = buffer || false;
}

EVR.Animation.prototype.play = function(method_name, delay)
{
   if (method_name == null)
   {
      method_name = DEFAULT_ANIMATION_METHOD_NAME;
   }
   var parameters = this.extract_parameters(arguments);
   var current = this;
   this.reset_last_ms(delay);
   this.interval = window.setTimeout(
      function()
      {
	 current.playing = true;
	 current.loop(method_name, parameters);
      }, delay);
}

EVR.Animation.prototype.reset_last_ms = function(delay)
{
   if (this.skip_frames)
   {
      this.last_ms = +new Date - this.rate;
      if (delay)
      {
	 this.last_ms += delay;
      }
   }
}

EVR.Animation.prototype.loop = function(method_name, parameters)
{
   var frames = 1;
   if (this.skip_frames)
   {
      frames += this.measure_deviation();
   }
   var current = this;
   for (var ii = 0; ii < frames; ii++)
   {
      current[method_name].apply(current, parameters);
   }
   if (this.playing)
   {
      this.interval = window.setTimeout(
	 function()
	 {
	    current.loop(method_name, parameters);
	 }, this.rate - this.buffer);
   }
}

EVR.Animation.prototype.measure_deviation = function()
{
   var count = 0;
   var time = +new Date;
   var difference = time - this.last_ms;
   var overflow = difference - this.rate;
   this.deviation += overflow;
   this.last_ms = time;
   if (this.deviation < -this.rate)
   {
      this.deviation += this.rate;
      count--;
   }
   else
   {
      while (this.deviation > this.rate)
      {
	 this.deviation -= this.rate;
	 count++;
      }
   }
   return count;
}

EVR.Animation.prototype.stop = function()
{
   window.clearInterval(this.interval);
   this.playing = false;
}

EVR.Animation.prototype.extract_parameters = function(list)
{
   if (list.length > 2)
   {
      list = Array.prototype.slice.call(list);
      return list.slice(2);
   }
   return [null];
}

EVR.Animation.prototype.toggle = function()
{
   if (this.playing)
   {
      this.stop();
   }
   else
   {
      this.play();
   }
}

EVR.Animation.prototype.toString = function()
{
   return "[object EVR.Animation]";
}
EVR.include("animation/ending/tombstone/Tombstone.js");
EVR.include("animation/ending/family/Family.js");
EVR.include("animation/ending/rainbow/Rainbow.js");
EVR.include("animation/ending/corpse/Corpse.js");
EVR.include("animation/ending/message/Message.js");
EVR.Animation.Ending = function(evr)
{
   this.evr = evr;
   this.container = evr.field;
   this.set_y_offset();
   this.add_children();
   this.playing = false;
   this.visible = false;
   this.finished = false;
}
EVR.Animation.Ending.prototype.set_y_offset = function()
{
   this.y_offset = -this.container.ground.get_dimensions(true)[1];
}
EVR.Animation.Ending.prototype.add_children = function()
{
   this.tombstone = new EVR.Animation.Ending.Tombstone(this);
   this.family  = new EVR.Animation.Ending.Family(this);
   this.rainbow = new EVR.Animation.Ending.Rainbow(this);
   this.corpse = new EVR.Animation.Ending.Corpse(this);
   this.message = new EVR.Animation.Ending.Message(this);
}
EVR.Animation.Ending.prototype.play = function()
{
   if (!this.playing)
   {
      var field = this.evr.field;
      field.stop_trees();
      field.set_color(ENDING_BACKGROUND);
      this.tombstone.append();
      this.family.append();
      this.rainbow.append();
      this.corpse.append();
      this.visible = true;
   }
   this.family.play();
   this.rainbow.play(null, RAINBOW_DELAY);
   this.playing = true;
}
EVR.Animation.Ending.prototype.display_message = function()
{
   if (this.playing)
   {
      this.message.append();
   }
}
EVR.Animation.Ending.prototype.stop = function()
{
   this.family.stop();
   this.rainbow.stop();
   this.corpse.stop();
   this.corpse.soul.stop();
   this.playing = false;
}
EVR.Animation.Ending.prototype.reset = function()
{
   this.rainbow.reset();
   this.family.reset();
   this.corpse.reset();
   this.message.remove();
}
EVR.Animation.Ending.prototype.clear = function()
{
   this.stop();
   this.reset();
   var field = this.evr.field;
   this.remove_children();
   field.start_trees();
   field.set_color(FIELD_COLORS[0]);
   this.finished = false;
   this.visible = false;
}
EVR.Animation.Ending.prototype.remove_children = function()
{
   this.tombstone.remove();
   this.family.remove();
   this.rainbow.remove();
   this.corpse.remove();
}
EVR.Animation.Ending.prototype.draw = function()
{
   if (this.visible)
   {
      this.tombstone.draw();
      this.family.draw();
      this.rainbow.draw();
      this.corpse.draw();
      this.message.draw();
   }
}
EVR.Animation.Ending.prototype.toString = function()
{
   return "[object EVR.Animation.Ending]";
}
18.224.73.43
18.224.73.43
18.224.73.43
 
September 30, 2015


Edge of Life is a form I made with Babycastles and Mouth Arcade for an event in New York called Internet Yami-ichi, a flea market of internet-ish goods. We set up our table to look like a doctor's office and pharmacy and offered free examinations and medication prescriptions, a system described by one person as "a whole pharmacy and medical industrial complex".

Diagnoses were based on responses to the form and observations by our doctor during a short examination. The examination typically involved bizarre questions, toy torpedoes being thrown at people and a plastic bucket over the patient's head. The form combined ideas from Myers-Briggs Type Indicators, Codex Seraphinianus and chain-mail personality tests that tell you which TV show character you are. In our waiting room, we had Lake of Roaches installed in a stuffed bat (GIRP bat). It was really fun!

The icons for the food pyramid are from Maple Story and the gun icons are from the dingbat font Outgunned. I'm also using Outgunned to generate the items in Food Spring.