<?php
namespace entities\html;

class Image extends Element
{
   public function __construct($src, $id=null, $class=null)
   {
      parent::__construct("img", $id, $class, false);
      $this->add_attribute("src", $src);
   }
}
<?php
namespace entities\html;

class Form
{
   public function __construct($id=null)
   {
      $this->id = $id;
   }
   public function __toString()
   {
      return $this->build_html();
   }
   private function build_html()
   {
      $markup = "<form method=\"post\"";
      if (!is_null($this->id))
      {
         $markup .= " id=\"" . $this->id . "\"";
      }
      $markup .= ">\n";
      $markup .= $this->build_content();
      $markup .= "</form>\n";
      return $markup;
   }
   protected function build_content()
   {
      return "&nbsp;\n";
   }
}
<?php
namespace entities\html;

class Meta extends Element
{
   public function __construct($content, $name=null, $http_equiv=null)
   {
      parent::__construct("meta", null, null, false);
      $this->add_attribute("name", $name);
      $this->add_attribute("http-equiv", $http_equiv);
      $this->add_attribute("content", $content);
   }
}
<?php
namespace entities\evr;

class Trailer extends \entities\html\IFrame
{
   public function __construct()
   {
      parent::__construct(
         "trailer", $GLOBALS["TRAILER_URL"], $GLOBALS["TRAILER_WIDTH"],
         $GLOBALS["TRAILER_HEIGHT"]);
      $this->add_attribute("webkitAllowFullScreen", true);
      $this->add_attribute("allowFullScreen", true);
   }
}
<?php
namespace entities\evr;
use \entities\html as html;

class Emoticon_Vs_Rainbow extends html\Page
{
   private $markup = "";
   public function __construct()
   {
      parent::__construct($GLOBALS["PAGE_TITLE"]);
   }
   protected function build_content()
   {
      $markup = new html\Image(
         $GLOBALS["LOADING_ANIMATION_PATH"], "loading_animation");
      $markup .= new html\Script($this->build_script_path());
      return $markup;
   }
   private function build_script_path()
   {
      return $this->determine_script_root() . $GLOBALS["GAME_PATH"];
   }
   private function determine_script_root()
   {
      $path = "src/game/stable/";
      if ($this->visitor_is_local() || isset($_GET["v"]))
      {
         if (!isset($_GET["s"]))
         {
            $path = "src/game/volatile/";
         }
      }
      return $path;
   }
   private function visitor_is_local()
   {
      $localhost = "127.0.0.1";
      $network = "/^192\.168\.0\..*/";
      $address = $_SERVER["REMOTE_ADDR"];
      return $address == $localhost || preg_match($network, $address);
   }
}
<?php
namespace entities\evr\security;

class Password_Mail extends Mail
{
   public function __construct($recipient, $password)
   {
      parent::__construct(
         $recipient, $GLOBALS["EMAIL_SENDER"],
         $GLOBALS["NEW_PASSWORD_SUBJECT"]);
      $this->password = $password;
   }
   protected function build_message()
   {
      $message = $GLOBALS["NEW_PASSWORD_PREFACE"] . " ";
      $message .= $this->password . "\n";
      return $message;
   }
}
<?php
namespace entities\evr\security;

class Cookie
{
   public function __construct()
   {
      $this->name = $GLOBALS["COOKIE_NAME"];
   }
   public function exists()
   {
      return isset($_COOKIE[$this->name]) && $_COOKIE[$this->name] != "";
   }
   public function set($username, $hash)
   {
      $value = "$username|$hash";
      $expiration = time() + 60 * 60 * 24 * 30;
      $domain = $_SERVER["HTTP_HOST"];
      setrawcookie($this->name, $value, $expiration, "/", $domain);
   }
   public function get()
   {
      return $_COOKIE[$this->name];
   }
   public function get_username()
   {
      $fields = explode("|", $this->get());
      return $fields[0];
   }
   public function get_hash()
   {
      $fields = explode("|", $this->get());
      return $fields[1];
   }
}
<?php
namespace entities\evr\security;

class Mail
{
   public function __construct($recipient, $sender, $subject)
   {
      $this->recipient = $recipient;
      $this->sender = $sender;
      $this->subject = $subject;
   }
   public function send()
   {
      $header = $this->build_header();
      $message = $this->build_message();
      return mail($this->recipient, $this->subject, $message, $header);
   }
   private function build_header()
   {
      $header = "From: " . $this->sender . "\r\n";
      $header .= "Content-Type: text/plain\r\n";
      return $header;
   }
   protected function build_message()
   {
      return "default message\n";
   }
}
216.73.216.8
216.73.216.8
216.73.216.8
 
September 13, 2013

from array import array
from time import sleep

import pygame
from pygame.mixer import Sound, get_init, pre_init

class Note(Sound):

    def __init__(self, frequency, volume=.1):
        self.frequency = frequency
        Sound.__init__(self, self.build_samples())
        self.set_volume(volume)

    def build_samples(self):
        period = int(round(get_init()[0] / self.frequency))
        samples = array("h", [0] * period)
        amplitude = 2 ** (abs(get_init()[1]) - 1) - 1
        for time in xrange(period):
            if time < period / 2:
                samples[time] = amplitude
            else:
                samples[time] = -amplitude
        return samples

if __name__ == "__main__":
    pre_init(44100, -16, 1, 1024)
    pygame.init()
    Note(440).play(-1)
    sleep(5)

This program generates and plays a 440 Hz tone for 5 seconds. It can be extended to generate the spectrum of notes with a frequency table or the frequency formula. Because the rewards in Send are idealized ocean waves, they can also be represented as tones. Each level has a tone in its goal and a tone based on where the player's disc lands. Both play at the end of a level, sounding harmonic for a close shot and discordant for a near miss. The game can dynamically create these tones using the program as a basis.

I'm also building an algorithmically generated song: Silk Routes (Scissored). Here is an example of how it sounds so far.