EVR.Account.Form.Forms.Login_Form = function(forms)
{
   EVR.Account.Form.call(this, forms.element, "Login");
   this.forms = forms;
   this.initialize();
   this.add_inputs();
}
EVR.Account.Form.Forms.Login_Form.prototype = new EVR.Account.Form;
EVR.Account.Form.Forms.Login_Form.prototype.add_inputs = function()
{
   this.add_input("name", "username");
   this.add_input("pass", "password", "password");
}
EVR.Account.Form.Forms.Login_Form.prototype.respond = function()
{
   var response = this.submit();
   if (response == "")
   {
      this.clear_errors();
      this.forms.account.evr.log_in();
   }
   else
   {
      var current = this;
      window.setTimeout(
	 function()
	 {
	    current.clear_errors();
	    current.handle_error(response)
	    current.display_errors();
	 }, FORM_RESULTS_DELAY);
   }
}
EVR.Account.Form.Forms.Login_Form.prototype.submit = function()
{
   var script = SOURCE_PATH + "account/submit_login_request.php";
   var query = this.build_query();
   return new EVR.Requester(script, query, true).execute();
}
EVR.Account.Form.Forms.Login_Form.prototype.handle_error = function(error)
{
   var erroneous = "";
   if (error == "username not found (note: usernames are case-sensitive)")
   {
      erroneous = "name";
   }
   else if (error == "password doesn't match username")
   {
      erroneous = "pass";
   }
   if (erroneous != "")
   {
      this.add_error(error, erroneous);
   }
   else
   {
      alert(error);
   }
}
EVR.Account.Form.Forms.Registration_Form = function(forms)
{
   EVR.Account.Form.call(this, forms.element, "Register");
   this.forms = forms;
   this.initialize();
   this.add_inputs();
}
EVR.Account.Form.Forms.Registration_Form.prototype = new EVR.Account.Form;
EVR.Account.Form.Forms.Registration_Form.prototype.add_inputs = function()
{
   this.add_input("user", "username");
   this.add_input("pass", "password", "password");
   this.add_input("repeat", "confirm password", "password");
   this.add_input("email", "email address");
}
EVR.Account.Form.Forms.Registration_Form.prototype.respond = function()
{
   var response = this.submit();
   if (response[0] == "")
   {
      this.clear_errors();
      this.forms.account.evr.log_in();
   }
   else
   {
      var current = this;
      window.setTimeout(
	 function()
	 {
	    current.clear_errors();
	    current.add_errors(response);
	    current.display_errors();
	 }, FORM_RESULTS_DELAY);
   }
}
EVR.Account.Form.Forms.Registration_Form.prototype.submit = function()
{
   var script = SOURCE_PATH + "account/submit_registration_request.php";
   var query = this.build_query();
   return new EVR.Requester(script, query, true).execute().split("\n");
}
EVR.Account.Form.Forms.Registration_Form.prototype.add_errors = function(errors)
{
   var error, erroneous, found, display_response = false;
   for (var ii = 0; ii < errors.length; ii++)
   {
      error = errors[ii];
      erroneous = [];
      found = false;
      switch (error)
      {
         case "username taken":
         case "username too short":
         case "username too long":
         case "username contains invalid characters":
	    erroneous.push("user");
	    found = true;
      }
      switch (error)
      {
         case "submitted passwords don't match":
         case "password too short":
         case "password too long":
	    erroneous.push("pass");
	    erroneous.push("repeat");
	    found = true;
      }
      switch (error)
      {
         case "invalid email address format":
	    erroneous.push("email");
	    found = true;
      }
      if (!found)
      {
	 display_response = true;
      }
      else
      {
	 this.add_error(error, erroneous);
      }
   }
   if (display_response)
   {
      alert(errors);
   }
}
EVR.Account.Form.Forms.Forgot_Password_Form = function(forms)
{
   EVR.Account.Form.call(this, forms.element, "Reset Password");
   this.forms = forms;
   this.initialize();
   this.add_inputs();
}
EVR.Account.Form.Forms.Forgot_Password_Form.prototype = new EVR.Account.Form;
EVR.Account.Form.Forms.Forgot_Password_Form.prototype.add_inputs = function()
{
   this.add_input("name", "username");
   this.add_input("email", "email address");
}
EVR.Account.Form.Forms.Forgot_Password_Form.prototype.respond = function()
{
   var response = this.submit();
   if (response == "")
   {
      this.clear_errors();
      this.forms.account.evr.unload_account();
   }
   else
   {
      var current = this;
      window.setTimeout(
	 function()
	 {
	    current.clear_errors();
	    current.handle_errors(response);
	    current.display_errors();
	 }, FORM_RESULTS_DELAY);
   }
}
EVR.Account.Form.Forms.Forgot_Password_Form.prototype.submit = function()
{
   var script = SOURCE_PATH + "account/submit_reset_password_request.php";
   var query = this.build_query();
   return new EVR.Requester(script, query, true).execute();
}
EVR.Account.Form.Forms.Forgot_Password_Form.prototype.handle_errors =
   function(error)
{
   switch (error)
   {
      case "submitted address doesn't match account address":
      case "mail delivery failed":
         this.add_error(error, "email");
         break;
      case "username not found":
         this.add_error(error, "name");
         break;
      default:
         alert(error);
   }
}
35.175.191.72
35.175.191.72
35.175.191.72
 
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