EVR.Pop_Up.Veil = function(container)
{
   EVR.Graphic.call(this, container);
   this.set_attributes();
   this.append();
}
EVR.Pop_Up.Veil.prototype = new EVR.Graphic;
EVR.Pop_Up.Veil.prototype.set_attributes = function()
{
   this.set_proportions(1, 1);
   this.set_z(POP_UP_VEIL_Z_INDEX);
   this.set_color(POP_UP_VEIL_COLOR);
   this.set_opacity(POP_UP_VEIL_OPACITY);
}
EVR.Pop_Up.Veil.prototype.toString = function()
{
   return "[object EVR.Pop_Up.Veil]";
}
EVR.include("element/pop_up/Veil.js");
EVR.Pop_Up = function(container, width, height)
{
   EVR.Graphic.call(this, container, null, null, ALIGN_CENTER);
   this.width = width;
   this.height = height;
   this.set_attributes();
   this.add_focus_receiver();
}
EVR.Pop_Up.prototype = new EVR.Graphic;
EVR.Pop_Up.prototype.set_attributes = function()
{
   this.set_proportions(this.width, this.height);
   this.set_z(POP_UP_WINDOW_Z_INDEX);
   var css = this.css;
   css.overflow = "auto";
   css.border = POP_UP_BORDER;
}
EVR.Pop_Up.prototype.add_focus_receiver = function()
{
   var link = document.createElement("a");
   link.href = "javascript: void(0)";
   this.element.appendChild(link);
   this.focus_receiver = link;
}
EVR.Pop_Up.prototype.draw = function()
{
   !!this.veil && this.veil.draw();
   EVR.Graphic.prototype.draw.call(this);
}
EVR.Pop_Up.prototype.append = function()
{
   EVR.Graphic.prototype.append.call(this);
   var link = this.focus_receiver;
   setTimeout(function() { link.focus() }, 50);
   this.veil = new EVR.Pop_Up.Veil(this.container);
}
EVR.Pop_Up.prototype.remove = function()
{
   EVR.Graphic.prototype.remove.call(this);
   this.veil.remove();
   this.veil = null;
}
EVR.Pop_Up.prototype.toString = function()
{
   return "[object EVR.Pop_Up]";
}
EVR.include("time/Translator.js");
EVR.Time = function(time)
{
   this.translator = new EVR.Time.Translator(time);
}
EVR.Time.prototype.add = function(time)
{
   this.translator.add(time);
}
EVR.Time.prototype.get = function()
{
   return this.translator.get();
}
EVR.Time.prototype.get_formatted = function(precision, padding)
{
   if (precision == null)
   {
      precision = CLOCK_PRECISION;
   }
   if (padding == null)
   {
      padding = CLOCK_PADDING;
   }
   var m = this.pad(this.get_minutes(), padding);
   var s = this.pad(this.get_seconds() % 60, 2);
   var string = m + ":" + s;
   if (precision > 0)
   {
      var ms = this.pad(this.get_milliseconds(precision), precision);
      string += "." + ms;
   }
   return string;
}
EVR.Time.prototype.get_milliseconds = function(precision)
{
   if (precision == null)
   {
      precision = 3;
   }
   return parseInt(this.get() % 1000 / (1000 / Math.pow(10, precision)));
}
EVR.Time.prototype.get_seconds = function()
{
   return parseInt(this.get() / 1000);
}
EVR.Time.prototype.get_minutes = function()
{
   return parseInt(this.get_seconds() / 60);
}
EVR.Time.prototype.pad = function(number, length)
{
   length -= number.toString().length;
   return new Array(length + 1).join("0") + number;
}
EVR.Time.prototype.toString = function(precision, padding)
{
   return this.get_formatted(precision, padding);
}
EVR.Time.Translator = function(time)
{
   this.time = this.convert(time) || 0;
}
EVR.Time.Translator.prototype.convert = function(time)
{
   if (!this.is_timestamp(time))
   {
      time = this.extract_timestamp(time);
   }
   return time;
}
EVR.Time.Translator.prototype.is_timestamp = function(time)
{
   return !/\./.test(time);
}
EVR.Time.Translator.prototype.extract_timestamp = function(time)
{
   var fields = time.match(/(.{1,2})\.(.{3})/);
   var timestamp = parseInt(fields[2], 10) + parseInt(fields[1], 10) * 1000;
   if (fields = time.match(/(.*):/))
   {
      timestamp += fields[1] * 60 * 1000;
   }
   return timestamp;
}
EVR.Time.Translator.prototype.get = function()
{
   return parseInt(this.time);
}
EVR.Time.Translator.prototype.add = function(time)
{
   this.time += this.convert(time);
}
EVR.Time.Translator.prototype.toString = function()
{
   return "[EVR.Time.Translator]";
}
EVR.Instructions = function(container)
{
   EVR.Pop_Up.call(this, container, INSTRUCTIONS_WIDTH, INSTRUCTIONS_HEIGHT);
   this.set_attributes();
   this.add_focus_receiver();
   this.include_document();
}
EVR.Instructions.prototype = new EVR.Pop_Up;
EVR.Instructions.prototype.set_attributes = function()
{
   EVR.Pop_Up.prototype.set_attributes.call(this);
   this.set_color(INSTRUCTIONS_BACKGROUND);
   var css = this.css;
   css.fontSize = INSTRUCTIONS_FONT_SIZE;
   css.fontFamily = INSTRUCTIONS_FONT_FAMILY;
   css.color = INSTRUCTIONS_FONT_COLOR;
   css.letterSpacing = INSTRUCTIONS_LETTER_SPACING;
   css.lineHeight = INSTRUCTIONS_LINE_HEIGHT;
   css.padding = INSTRUCTIONS_PADDING;
}
EVR.Instructions.prototype.include_document = function()
{
   var path = SOURCE_PATH + "instructions/instructions";
   var document = new EVR.Requester(path, null, true).execute().split("\n\n");
   this.translate_document(document);
}
EVR.Instructions.prototype.translate_document = function(document)
{
   var line;
   for (var ii = 0; ii < document.length; ii++)
   {
      line = document[ii];
      if (/^img\//.test(line))
      {
	 this.add_image(line);
	 continue;
      }
      this.add_paragraph(line);
   }
}
EVR.Instructions.prototype.add_image = function(src)
{
   var element = document.createElement("img");
   element.src = src;
   element.style.display = "block";
   element.style.margin = INSTRUCTIONS_IMAGE_MARGIN + " auto";
   this.element.appendChild(element);
}
EVR.Instructions.prototype.add_paragraph = function(text)
{
   var element = document.createElement("p");
   var style = element.style;
   element.innerHTML = text;
   style.textAlign = INSTRUCTIONS_PARAGRAPH_TEXT_ALIGN;
   style.background = INSTRUCTIONS_PARAGRAPH_BACKGROUND;
   style.padding = INSTRUCTIONS_PARAGRAPH_PADDING;
   this.element.appendChild(element);
}
EVR.Instructions.prototype.toString = function()
{
   return "[object EVR.Instructions]";
}
35.175.133.71
35.175.133.71
35.175.133.71
 
June 29, 2013

A few weeks ago, for Fishing Jam, I made a fishing simulation from what was originally designed to be a time attack arcade game. In the program, Dark Stew, the player controls Aphids, an anthropod who fishes for aquatic creatures living in nine pools of black water.



Fishing means waiting by the pool with the line in. The longer you wait before pulling the line out, the more likely a creature will appear. Aside from walking, it's the only interaction in the game. The creatures are drawings of things you maybe could find underwater in a dream.

The background music is a mix of clips from licensed to share songs on the Free Music Archive. Particularly, Seed64 is an album I used a lot of songs from. The full list of music credits is in the game's README file.

I'm still planning to use the original design in a future version. There would be a reaction-based mini game for catching fish, and the goal would be to catch as many fish as possible within the time limit. I also want to add details and obstacles to the background, which is now a little boring, being a plain, tiled, white floor.

If you want to look at all the drawings or hear the music in the context of the program, there are Windows and source versions available. The source should work on any system with Python and Pygame. If it doesn't, bug reports are much appreciated. Comments are also welcome :)

Dark Stew: Windows, Pygame Source

I wrote in my last post that I would be working on an old prototype about searching a cloud for organisms for Fishing Jam. I decided to wait a while before developing that game, tentatively titled Xenographic Barrier. Its main interactive element is a first-person scope/flashlight, so I'd like to make a Wii version of it.

I'm about to start working on a complete version of Ball & Cup. If I make anything interesting for it, I'll post something. There are a lot of other things I want to write about, like game analyses, my new GP2X and arcades in Korea, and there's still music to release. Lots of fun stuff coming!