EVR.include("level/cheers/marquee/Spectrum.js");
EVR.Level.Cheers.Marquee = function(
   cheers, color_offset, placement_offset, z_index, opacity)
{
   EVR.Graphic.call(this, cheers);
   this.cheers = cheers;
   this.spectrum = new EVR.Level.Cheers.Marquee.Spectrum(color_offset);
   this.placement_offset = placement_offset || [0, 0];
   this.z_index = z_index || 0;
   this.spectrum_index = CHEERS_SPECTRUM_STARTING_INDEX;
   this.font_size = CHEERS_FONT_SIZE;
   this.opacity = opacity;
   this.glyphs = [];
   this.setAttributes();
   this.append();
}
EVR.Level.Cheers.Marquee.prototype = new EVR.Graphic;
EVR.Level.Cheers.Marquee.prototype.setAttributes = function()
{
   this.set_z(this.z_index);
   this.set_opacity(this.opacity);
   var css = this.css;
   css.fontWeight = "bold";
   css.textAlign = "left";
   css.whiteSpace = "nowrap";
   this.setFontSize();
}
EVR.Level.Cheers.Marquee.prototype.setFontSize = function()
{
   var dimensions = this.cheers.level.container.get_dimensions();
   var modifier = dimensions[1] / dimensions[0];
   var basis = dimensions[0] * modifier;
   var size = parseInt(basis * this.font_size);
   this.css.fontSize = size + "px";
   this.whitespace_length = basis * CHEERS_GLYPH_PADDING;
}
EVR.Level.Cheers.Marquee.prototype.place = function()
{
   EVR.Graphic.prototype.place.call(this, 0, CHEERS_MARQUEE_OFFSET);
   var x = this.get_coordinates()[0] + this.placement_offset[0];
   var y = this.get_coordinates()[1] + this.placement_offset[1];
   this.set_coordinates([x, y]);
}
EVR.Level.Cheers.Marquee.prototype.addCheer = function(cheer)
{
   var parent = this.element;
   for (var ii = cheer.length - 1; ii >= 0; ii--)
   {
      var color = this.spectrum.get(this.spectrum_index);
      this.addGlyph(cheer.charAt(ii), color, ii == cheer.length - 1);
   }
}
EVR.Level.Cheers.Marquee.prototype.addGlyph = function(character, color, pad)
{
   var parent = this.element;
   var element = document.createElement("span");
   element.innerHTML = character;
   element.style.color = color;
   parent.insertBefore(element, parent.firstChild);
   if (pad)
   {
      element.style.paddingRight = this.whitespace_length + "px";
   }
   this.glyphs.push(element);
   this.spectrum_index++;
}
EVR.Level.Cheers.Marquee.prototype.addJeer = function()
{
   var color = CHEERS_JEER_COLOR;
   var jeer = CHEERS_JEER_TEXT;
   for (var ii = jeer.length - 1; ii >= 0; ii--)
   {
      this.addGlyph(jeer.charAt(ii), color, ii == jeer.length - 1);
   }
}
EVR.Level.Cheers.Marquee.prototype.draw = function()
{
   EVR.Graphic.prototype.draw.call(this);
   this.setFontSize();
   var glyph, glyphs = this.glyphs;
   for (var ii = 0; ii < glyphs.length; ii++)
   {
      glyph = glyphs[ii];
      if (parseInt(glyph.style.paddingRight) > 0)
      {
	 glyph.style.paddingRight = this.whitespace_length;
      }
   }
}
EVR.Level.Cheers.Marquee.prototype.toString = function()
{
   return "[EVR.Level.Cheers.Marquee]";
}
EVR.Level.Cheers.Marquee.Spectrum = function(offset)
{
   this.offset = offset;
   this.build();
}
EVR.Level.Cheers.Marquee.Spectrum.prototype.build = function()
{
   var max = 255 - this.offset;
   var count = CHEERS_SPECTRUM_LENGTH;
   var interval = Math.round(count / 6);
   var step = Math.round(max / (interval - 1));
   var component, color, spectrum = [];
   for (var ii = 0; ii < interval; ii++)
   {
      component = step * ii;
      spectrum.push(new EVR.Color([max, component, 0]));
   }
   for (var ii = interval - 1; ii >= 0; ii--)
   {
      component = step * ii;
      spectrum.push(new EVR.Color([component, max, 0]));
   }
   for (var ii = 0; ii < interval; ii++)
   {
      component = step * ii;
      spectrum.push(new EVR.Color([0, max, component]));
   }
   for (var ii = interval - 1; ii >= 0; ii--)
   {
      component = step * ii;
      spectrum.push(new EVR.Color([0, component, max]));
   }
   for (var ii = 0; ii < interval; ii++)
   {
      component = step * ii;
      spectrum.push(new EVR.Color([component, 0, max]));
   }
   for (var ii = interval - 1; ii >= 0; ii--)
   {
      component = step * ii;
      spectrum.push(new EVR.Color([max, 0, component]));
   }
   this.spectrum = spectrum;
}
EVR.Level.Cheers.Marquee.Spectrum.prototype.get = function(index)
{
   var spectrum = this.spectrum;
   return spectrum[index % spectrum.length].get_string();
}
EVR.Level.Cheers.Marquee.Spectrum.toString = function()
{
   return "[object EVR.Level.Cheers.Marquee.Spectrum]";
}
EVR.include("level/loader/Parser.js");
EVR.Level.Loader = function(level)
{
   this.level = level;
}
EVR.Level.Loader.prototype.load = function()
{
   this.build_requester();
   var document = this.requester.execute();
   this.parser = new EVR.Level.Loader.Parser(this.level, document);
}
EVR.Level.Loader.prototype.build_requester = function()
{
   var path = SOURCE_PATH + "level/loader/fetch.php";
   var query = "id=" + this.level.id;
   this.requester = new EVR.Requester(path, query);
}
EVR.Level.Loader.prototype.toString = function()
{
   return "[object EVR.Level.Loader]";
}
EVR.Level.Loader.Parser = function(level, document)
{
   this.level = level;
   this.root = document.getElementsByTagName("level")[0];
   this.parse();
}
EVR.Level.Loader.Parser.prototype.parse = function()
{
   this.parse_attributes();
   this.parse_sky();
   this.parse_beams();
   this.parse_path();
}
EVR.Level.Loader.Parser.prototype.parse_attributes = function()
{
   var level = this.level;
   var root = this.root;
   level.background = root.getAttribute("background");
   level.goal = new EVR.Time(root.getAttribute("goal"));
   level.advanced = new EVR.Time(root.getAttribute("advanced"));
   level.threshold = parseFloat(root.getAttribute("threshold"));
   level.sound.set_song(root.getAttribute("song"));
}
EVR.Level.Loader.Parser.prototype.parse_sky = function()
{
   var node = this.root.getElementsByTagName("sky")[0];
   var tags = node.getElementsByTagName("background");
   var sky = this.level.sky = [];
   for (var ii = 0; ii < tags.length; ii++)
   {
      sky.push(tags[ii].getAttribute("color"));
   }
}
EVR.Level.Loader.Parser.prototype.parse_beams = function()
{
   var node = this.root.getElementsByTagName("beams")[0];
   var tags = node.getElementsByTagName("beam");
   this.level.beams = [];
   for (var ii = 0; ii < tags.length; ii++)
   {
      this.level.beams.push(tags[ii].getAttribute("color"));
   }
}
EVR.Level.Loader.Parser.prototype.parse_path = function()
{
   var node = this.root.getElementsByTagName("path")[0];
   var tags = node.getElementsByTagName("cluster");
   this.level.clusters = [];
   for (var ii = 0; ii < tags.length; ii++)
   {
      this.add_cluster(tags[ii]);
   }
}
EVR.Level.Loader.Parser.prototype.add_cluster = function(tag)
{
   var level = this.level;
   var passage = tag.getAttribute("passage");
   var width = tag.getAttribute("width");
   var gap = tag.getAttribute("gap");
   var cluster = new EVR.Level.Cluster(passage, width, gap, level.practice);
   level.clusters.push(cluster);
}
EVR.Level.Loader.Parser.prototype.toString = function()
{
   return "[object EVR.Level.Loader.Parser]";
}
216.73.216.141
216.73.216.141
216.73.216.141
 
December 3, 2013

Where in the mind's prism does light shine, inward, outward, or backward, and where in a plane does it intersect, experientially and literally, while possessing itself in a dripping wet phantasm?


Fig 1.1 What happens after you turn on a video game and before it appears?

The taxonomy of fun contains the difference between gasps of desperation and exaltation, simultaneously identical and opposite; one inspires you to have sex, while the other to ejaculate perpetually. A destruction and its procession are effervescent, while free play is an inseminated shimmer hatching inside you. Unlikely to be resolved, however, in such a way, are the climaxes of transitions between isolated, consecutive game states.

You walk through a door or long-jump face first (your face, not Mario's) into a painting. A moment passes for eternity, viscerally fading from your ego, corpus, chakra, gaia, the basis of your soul. It happens when you kill too, and especially when you precisely maim or obliterate something. It's a reason to live, a replicating stasis.


Fig 1.2 Sequence in a video game

Video games are death reanimated. You recurse through the underworld toward an illusion. Everything in a decision and logic attaches permanently to your fingerprint. At the core, you use its energy to soar, comatose, back into the biosphere, possibly because the formal structure of a mind by human standards is useful in the next world.