summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Grumpy-bubble.pngbin0 -> 707 bytes
-rw-r--r--Happy-oxygen-bubble-v2.pngbin0 -> 267 bytes
-rw-r--r--Happy-oxygen-bubble.pngbin0 -> 205 bytes
-rw-r--r--Stilla-the-starfish.pngbin0 -> 1199 bytes
-rw-r--r--SunkenMoon.html434
-rw-r--r--SunkenMoon.html.coffee414
6 files changed, 848 insertions, 0 deletions
diff --git a/Grumpy-bubble.png b/Grumpy-bubble.png
new file mode 100644
index 0000000..2053221
--- /dev/null
+++ b/Grumpy-bubble.png
Binary files differ
diff --git a/Happy-oxygen-bubble-v2.png b/Happy-oxygen-bubble-v2.png
new file mode 100644
index 0000000..7190965
--- /dev/null
+++ b/Happy-oxygen-bubble-v2.png
Binary files differ
diff --git a/Happy-oxygen-bubble.png b/Happy-oxygen-bubble.png
new file mode 100644
index 0000000..7529157
--- /dev/null
+++ b/Happy-oxygen-bubble.png
Binary files differ
diff --git a/Stilla-the-starfish.png b/Stilla-the-starfish.png
new file mode 100644
index 0000000..7d1dae5
--- /dev/null
+++ b/Stilla-the-starfish.png
Binary files differ
diff --git a/SunkenMoon.html b/SunkenMoon.html
new file mode 100644
index 0000000..6857211
--- /dev/null
+++ b/SunkenMoon.html
@@ -0,0 +1,434 @@
+<!DOCTYPE 5>
+<html><head><meta charset="utf-8"><link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAIAEBAAAAEACABoBQAAJgAAACAgAAABABgAqAwAAI4FAAAoAAAAEAAAACAAAAABAAgAAAAAAAABAAAAAAAAAAAAAAABAAAAAAAAKCcrAHx1eACOipIAExUaAHGChAADAAAAMSAoAPfz8ADi4NwAeHqHAFZQUwABBgkAztHLAIB8ewC8t70A5uTfABoaIABcXFwA7OroAJagngDt7egAmKCeAExKSwCHhY0A3NrUAI+GhwChm6EAZWJlAH5zcwCNipMAPTpAACgnLABIW1oA9vLuAGlkYgBPVVoAU1FXABYVGwAUGBsA5ODdABYYGwAr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IhgcIxwdJR0eJR0gJx8gKCAhKSEiKSEiKSEiKCEiKCEiKSEiKSEiKSEiKicmLycnLyAoLR8oLX10dn55e4N9fXp1dnh0dXh0dXdzcXVycnVxcnRubnBqcmFgaUFETSImLRocIxweJhwfJR4fKB4gKBwdJhweJh0fJyIkKyIkKiEjKiEjKh8hKCAiKCMkKiIkKiQlLCQlLGpkZW5tbHVycXRxcW9tbXBubm1samlpaGtpamxnaWtjbWZjbGFgaVxVXkI8RCQkLB8gKB8gKR8hKBweJh0eJx0fJxweJh8hKCEiKh8hKRwdJRwdJh8gKB4gKCIjKiIjKgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"><title>Vilma, the happy Vaquita - Sunken Moon</title><style type="text/css">body {
+ /* background:pink; */
+ /* background: #69B2FF; */
+ /* background: #21AFF8; */
+ /* background: #0286E8; */
+ /* background: #1096EE; */
+ background:black;
+ text-align: center;
+ font-size: 22px;
+ font-family: Helvetica;
+ color:white;
+ color:rgba(255,255,255,0.9);
+ margin:0;
+}
+.banner {
+ border: 5px solid white;
+ border: 5px solid white rgba(255,255,255,0.9);
+ box-shadow: 0 2px 4px blue;
+ margin: 1em;
+}
+footer, p {
+ margin-top:0.418em;
+ margin-bottom:0.418em;
+ margin-left:auto;
+ margin-right:auto;
+ text-shadow: 0 1px 1px blue;
+}
+p {
+ width:22em;
+ max-width:100%;
+}
+a {
+ /*
+ color:rgb(200,255,255);
+ color:rgba(200,255,255,0.9);
+ */
+ color:white;
+ color:rgba(255,255,255,0.9);
+ text-decoration:none;
+ display: inline-block;
+ border: 1px solid white;
+ padding: 0 0.2em;
+ border-radius: 0.2em;
+ -moz-border-radius: 0.2em;
+ -webkit-border-radius: 0.2em;
+ -ie-border-radius: 0.2em;
+}
+a:hover {
+ background-color:rgba(20,70,180,1.0);
+}
+.petition {
+ margin:0.418em;
+ padding:0.618em;
+}
+.petition a {
+ font-size:127.2%;
+ box-shadow: 0 2px 4px blue;
+ margin:0.3em;
+}
+.page {
+ width: 100%;
+ height: 100%;
+ margin: 0;
+ border: 0;
+}
+.centering {
+ display: table;
+ padding: 0;
+}
+.centered {
+ display: table-cell;
+ vertical-align: middle;
+ text-align: center;
+}
+.inline-block {
+ display: inline-block;
+}
+.dynamic-section {
+ display: inline-block;
+ vertical-align:middle;
+ max-width:100%;
+}
+.flip-lr {
+ -moz-transform: scaleX(-1);
+ -o-transform: scaleX(-1);
+ -webkit-transform: scaleX(-1);
+ transform: scaleX(-1);
+ filter: FlipH;
+ -ms-filter: "FlipH";
+}
+image, .pixelart {
+ image-rendering:optimizeSpeed; /* Legal fallback */
+ image-rendering:-moz-crisp-edges; /* Firefox */
+ image-rendering:-o-crisp-edges; /* Opera */
+ image-rendering:-webkit-optimize-contrast; /* Safari */
+ image-rendering:optimize-contrast; /* CSS3 Proposed */
+ image-rendering:crisp-edges; /* CSS4 Proposed */
+ image-rendering:pixelated; /* CSS4 Proposed */
+ -ms-interpolation-mode:nearest-neighbor; /* IE8+ */
+}
+/*
+.pixelart {
+ image-rendering: -moz-crisp-edges;
+ -ms-interpolation-mode: nearest-neighbor;
+ image-rendering: pixelated;
+ image-rendering: crisp-edges;
+}
+*/
+g.flipped {
+ transform:scale(-1,1);
+}
+.dim {
+ opacity: 0.2;
+}
+.dim:hover {
+ opacity: 1;
+}</style></head><body><div class="centering page"><div class="centered"><div style="visibility:hidden;position:absolute"><img id="pixyvaquita" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAeCAYAAABuUU38AAAFWElEQVRYw+2WX0gcVxTGv7l3Zmd2drs6aHaNW7Jd88cYDaQYI1jsQ5GSh1BCAhUsNQ/JWxT6lLKExISCQkBECoW+6IMJEknaIEKQbKXJ5iFY6mKsEhO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N8Wq8itNnDjrJVUkSieOwwI8MwOOdkp6eLUuUF5WsCHM1B3/jnCXtMzbc+ct0yYfnC5u1nlC9/ne0SwvlOYsnCWibNdKyRtD6Fb2IadUqaMaUSGusnd9WS9T9/FfwCFcIToaBH7usAAAAASUVORK5CYII="></div><div style="position:relative"><svg id="sea-svgroot" width="960" height="720" style="position:absolute;opacity:0.9;z-index:-1000"><defs><linearGradient id="grad1" x1="0%" y1="0%" x2="0%" y2="100%"><stop offset="0%" style="stop-color:rgb(255,255,255);stop-opacity:1"></stop><stop offset="25%" style="stop-color:rgb(100,200,250);stop-opacity:1"></stop><stop offset="50%" style="stop-color:rgb(0,80,240);stop-opacity:1"></stop><stop offset="75%" style="stop-color:rgb(0,0,180);stop-opacity:1"></stop><stop offset="100%" style="stop-color:rgb(0,0,0);stop-opacity:1"></stop></linearGradient></defs><rect x="0" y="0" width="960" height="720" fill="url(#grad1)"></rect></svg><canvas width="960" height="720"></canvas></div><footer class="dim"><span>Vilma, the happy Vaquita - Sunken Moon v0.1.105</span><span> - </span><a target="_blank" href="index.html">Learn about Vaquitas</a><span id="fps"></span></footer></div></div><script type="text/javascript">gameObjects=null;</script><script type="text/javascript">__hasProp = {}.hasOwnProperty; __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };</script><script type="text/javascript">var jaws=function(t){function e(e){t.mouse_x=e.pageX||e.clientX,t.mouse_y=e.pageY||e.clientY;var i=t.canvas?t.canvas:t.dom;t.mouse_x-=i.offsetLeft,t.mouse_y-=i.offsetTop}var i,s;return t.SpriteList=function(){throw"To use SpriteList() you need to include src/extras/sprite_list.js"},t.Audio=function(){throw"To use jaws.Audio() you need to include src/extras/audio.js"},t.title=function(e){return t.isString(e)?e?i.innerHTML=e:i.innerHTML:void t.log.error("jaws.title: Passed in value is not a String.")},t.unpack=function(){var e=["Sprite","SpriteList","Animation","SpriteSheet","Parallax","pressed","QuadTree"];e.forEach(function(e){window[e]?t.log.warn("jaws.unpack: "+e+" already exists in global namespace."):window[e]=t[e]})},t.log=function(e,i){t.isString(e)||(e=JSON.stringify(e)),t.log.on&&(s&&t.log.use_log_element&&(i?s.innerHTML+=e+"<br />":s.innerHTML=e),console.log&&t.log.use_console&&console.log("JawsJS: ",e))},t.log.on=!0,t.log.use_console=!1,t.log.use_log_element=!0,t.log.warn=function(e){console.warn&&t.log.use_console&&t.log.on?console.warn(e):t.log("[WARNING]: "+JSON.stringify(e),!0)},t.log.error=function(e){console.error&&t.log.use_console&&t.log.on?console.error(e):t.log("[ERROR]: "+JSON.stringify(e),!0)},t.log.info=function(e){console.info&&t.log.use_console&&t.log.on?console.info(e):t.log("[INFO]: "+JSON.stringify(e),!0)},t.log.debug=function(e){console.debug&&t.log.use_console&&t.log.on?console.debug(e):t.log("[DEBUG]: "+JSON.stringify(e),!0)},t.log.clear=function(){s&&(s.innerHTML=""),console.clear&&console.clear()},t.init=function(o){i=document.getElementsByTagName("title")[0],t.url_parameters=t.getUrlParameters(),t.canvas=document.getElementsByTagName("canvas")[0],t.canvas||(t.dom=document.getElementById("canvas")),t.canvas?t.context=t.canvas.getContext("2d"):t.dom?t.dom.style.position="relative":(t.canvas=document.createElement("canvas"),t.canvas.width=o.width,t.canvas.height=o.height,t.context=t.canvas.getContext("2d"),document.body.appendChild(t.canvas)),s=document.getElementById("jaws-log"),t.url_parameters.debug&&(s||(s=document.createElement("div"),s.id="jaws-log",s.style.cssText="overflow: auto; color: #aaaaaa; width: 300px; height: 150px; margin: 40px auto 0px auto; padding: 5px; border: #444444 1px solid; clear: both; font: 10px verdana; text-align: left;",document.body.appendChild(s))),t.url_parameters.bust_cache&&(t.log.info("Busting cache when loading assets"),t.assets.bust_cache=!0),t.context&&t.useCrispScaling(),t.width=t.canvas?t.canvas.width:t.dom.offsetWidth,t.height=t.canvas?t.canvas.height:t.dom.offsetHeight,t.mouse_x=0,t.mouse_y=0,window.addEventListener("mousemove",e)},t.useCrispScaling=function(){t.context.imageSmoothingEnabled=!1,t.context.webkitImageSmoothingEnabled=!1,t.context.mozImageSmoothingEnabled=!1},t.useSmoothScaling=function(){t.context.imageSmoothingEnabled=!0,t.context.webkitImageSmoothingEnabled=!0,t.context.mozImageSmoothingEnabled=!0},t.start=function(e,i,s){function o(e,s){t.log.info(s+"%: "+e,!0),i.loading_screen&&t.assets.displayProgress(s)}function n(e,i){t.log.info(i+"%: Error loading asset "+e,!0)}function a(){t.log.info("all assets loaded",!0),t.switchGameState(e||window,{fps:r},s)}i||(i={});var r=i.fps||60;return void 0===i.loading_screen&&(i.loading_screen=!0),i.width||(i.width=500),i.height||(i.height=300),t.init(i),t.isFunction(e)||t.isObject(e)?t.isObject(s)||void 0===s?(i.loading_screen&&t.assets.displayProgress(0),t.log.info("setupInput()",!0),t.setupInput(),t.log.info("assets.loadAll()",!0),void(t.assets.length()>0?t.assets.loadAll({onprogress:o,onerror:n,onload:a}):a())):void t.log.error("jaws.start: The setup options for the game state is not an object."):void t.log.error("jaws.start: Passed in GameState is niether function or object")},t.switchGameState=function(e,i,s){if(void 0===i&&(i={}),t.isFunction(e)&&(e=new e),!t.isObject(e))return void t.log.error("jaws.switchGameState: Passed in GameState should be a Function or an Object.");var o=i&&i.fps||t.game_loop&&t.game_loop.fps||60,n=i.setup;t.game_loop&&t.game_loop.stop(),t.clearKeyCallbacks(),t.previous_game_state=t.game_state,t.game_state=e,t.game_loop=new t.GameLoop(e,{fps:o,setup:n},s),t.game_loop.start()},t.imageToCanvas=function(e){if(t.isCanvas(e))return e;if(!t.isImage(e))return void t.log.error("jaws.imageToCanvas: Passed in object is not an Image.");var i=document.createElement("canvas");i.src=e.src,i.width=e.width,i.height=e.height;var s=i.getContext("2d");return s.drawImage(e,0,0,e.width,e.height),i},t.forceArray=function(t){return Array.isArray(t)?t:[t]},t.clear=function(){t.context.clearRect(0,0,t.width,t.height)},t.fill=function(e){t.context.fillStyle=e,t.context.fillRect(0,0,t.width,t.height)},t.draw=function(){var e=arguments;1==e.length&&t.isArray(e[0])&&(e=e[0]);for(var i=0;i<e.length;i++)t.isArray(e[i])?t.draw(e[i]):e[i].draw&&e[i].draw()},t.update=function(){var e=arguments;1==e.length&&t.isArray(e[0])&&(e=e[0]);for(var i=0;i<e.length;i++)t.isArray(e[i])?t.update(e[i]):e[i].update&&e[i].update()},t.isImage=function(t){return"[object HTMLImageElement]"===Object.prototype.toString.call(t)},t.isCanvas=function(t){return"[object HTMLCanvasElement]"===Object.prototype.toString.call(t)},t.isDrawable=function(e){return t.isImage(e)||t.isCanvas(e)},t.isString=function(t){return"string"==typeof t||"object"==typeof t&&t.constructor===String},t.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},t.isArray=function(t){return t?!(-1===t.constructor.toString().indexOf("Array")):!1},t.isObject=function(t){return null!==t&&"object"==typeof t},t.isFunction=function(t){return"[object Function]"===Object.prototype.toString.call(t)},t.isRegExp=function(t){return t instanceof RegExp},t.isOutsideCanvas=function(e){return e.x&&e.y?e.x<0||e.y<0||e.x>t.width||e.y>t.height:void 0},t.forceInsideCanvas=function(e){e.x&&e.y&&(e.x<0&&(e.x=0),e.x>t.width&&(e.x=t.width),e.y<0&&(e.y=0),e.y>t.height&&(e.y=t.height))},t.getUrlParameters=function(){for(var t,e=[],i=window.location.href.slice(window.location.href.indexOf("?")+1).split("&"),s=0;s<i.length;s++)t=i[s].split("="),e.push(t[0]),e[t[0]]=t[1];return e},t.parseOptions=function(e,i,s){e.options=i;for(var o in i)void 0===s[o]&&t.log.warn("jaws.parseOptions: Unsupported property "+o+"for "+e.constructor);for(var o in s)t.isFunction(s[o])&&(s[o]=s[o]()),e[o]=void 0!==i[o]?i[o]:t.clone(s[o])},t.clone=function(e){return t.isArray(e)?e.slice(0):t.isObject(e)?JSON.parse(JSON.stringify(e)):e},t.imageToCanvasContext=function(e){var i=document.createElement("canvas");i.width=e.width,i.height=e.height;var s=i.getContext("2d");return t.context&&(s.imageSmoothingEnabled=t.context.mozImageSmoothingEnabled,s.webkitImageSmoothingEnabled=t.context.mozImageSmoothingEnabled,s.mozImageSmoothingEnabled=t.context.mozImageSmoothingEnabled),s.drawImage(e,0,0,i.width,i.height),s},t.retroScaleImage=function(e,i){var s=t.isImage(e)?t.imageToCanvas(e):e,o=s.getContext("2d"),n=o.getImageData(0,0,s.width,s.height).data,a=document.createElement("canvas");a.width=e.width*i,a.height=e.height*i;for(var r=a.getContext("2d"),h=r.createImageData(a.width,a.height),c=h.width,l=h.height,u=0;l>u;u+=1)for(var d=Math.floor(u/i),f=u*h.width,p=d*e.width,g=0;c>g;g+=1){var m=Math.floor(g/i),w=4*(f+g),x=4*(p+m);h.data[w]=n[x],h.data[w+1]=n[x+1],h.data[w+2]=n[x+2],h.data[w+3]=n[x+3]}return r.putImageData(h,0,0),a},t}(jaws||{});"undefined"!=typeof module&&"exports"in module&&(module.exports=jaws);var jaws=function(t){function e(){for(var t in h)delete h[t]}function i(t){var e=e=t.keyCode;h[e]=!1,d[e]?(d[e](e),t.preventDefault()):g[e]&&t.preventDefault()}function s(t){var e=e=t.keyCode;h[e]=!0,u[e]?(u[e](e),t.preventDefault()):g[e]&&t.preventDefault()}function o(t){var e=f[t.button];"Microsoft Internet Explorer"==navigator.appName&&(e=p[t.button]),h[e]=!0,u[e]&&(u[e](e),t.preventDefault())}function n(t){var e=f[t.button];"Microsoft Internet Explorer"==navigator.appName&&(e=p[t.button]),h[e]=!1,d[e]&&(d[e](e),t.preventDefault())}function a(e){h.left_mouse_button=!0,t.mouse_x=e.touches[0].pageX-t.canvas.offsetLeft,t.mouse_y=e.touches[0].pageY-t.canvas.offsetTop}function r(){h.left_mouse_button=!1,t.mouse_x=void 0,t.mouse_y=void 0}var h={},c={0:"48",1:"49",2:"50",3:"51",4:"52",5:"53",6:"54",7:"55",8:"56",9:"57",backspace:"8",tab:"9",enter:"13",shift:"16",ctrl:"17",alt:"18",pause:"19",caps_lock:"20",esc:"27",space:"32",page_up:"33",page_down:"34",end:"35",home:"36",left:"37",up:"38",right:"39",down:"40",insert:"45","delete":"46",a:"65",b:"66",c:"67",d:"68",e:"69",f:"70",g:"71",h:"72",i:"73",j:"74",k:"75",l:"76",m:"77",n:"78",o:"79",p:"80",q:"81",r:"82",s:"83",t:"84",u:"85",v:"86",w:"87",x:"88",y:"89",z:"90",windows_left:"91",windows_right:"92",select:"93",numpad0:"96",numpad1:"97",numpad2:"98",numpad3:"99",numpad4:"100",numpad5:"101",numpad6:"102",numpad7:"103",numpad8:"104",numpad9:"105",asterisk:"106",plus:"107",minus:"109",decimal_point:"110",divide:"111",f1:"112",f2:"113",f3:"114",f4:"115",f5:"116",f6:"117",f7:"118",f8:"119",f9:"120",numlock:"144",scrollock:"145",semicolon:"186",equals:"187",comma:"188",dash:"189",period:"190",slash:"191",grave_accent:"192",open_bracket:"219",backslash:"220",close_bracket:"221",single_quote:"222"},l={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"caps_lock",27:"esc",32:"space",33:"page_up",34:"page_down",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",91:"windows_left",92:"windows_right",93:"select",96:"numpad0",97:"numpad1",98:"numpad2",99:"numpad3",100:"numpad4",101:"numpad5",102:"numpad6",103:"numpad7",104:"numpad8",105:"numpad9",106:"asterisk",107:"plus",109:"minus",110:"decimal_point",111:"divide",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",144:"numlock",145:"scrollock",186:"semicolon",187:"equals",188:"comma",189:"dash",190:"period",191:"slash",192:"grave_accent",219:"open_bracket",220:"backslash",221:"close_bracket",222:"single_quote"},u=[],d=[],f=[],p=[],g=[];return t.setupInput=function(){var h=[];h[0]="left_mouse_button",h[1]="center_mouse_button",h[2]="right_mouse_button";var c=[];c[1]="left_mouse_button",c[2]="right_mouse_button",c[4]="center_mouse_button",f=h,p=c,window.addEventListener("keydown",s),window.addEventListener("keyup",i);var l=t.canvas||t.dom;l.addEventListener("mousedown",o,!1),l.addEventListener("mouseup",n,!1),l.addEventListener("touchstart",a,!1),l.addEventListener("touchend",r,!1),window.addEventListener("blur",e,!1),document.oncontextmenu=function(){return!1}},t.preventDefaultKeys=function(){for(var t=arguments,e=0;e<t.length;e++)g[t[e]]=!0},t.pressed=h,t.keyCodes=c,t.keycodeNames=l,t.on_keydown=function(e,i){if(t.isArray(e))for(var s=0;e[s];s++)u[e[s]]=i;else u[e]=i},t.on_keyup=function(e,i){if(t.isArray(e))for(var s=0;e[s];s++)d[e[s]]=i;else d[e]=i},t.clearKeyCallbacks=function(){d=[],u=[]},t}(jaws||{}),jaws=function(t){function e(e){if(t.isDrawable(e)){for(var i=t.isImage(e)?t.imageToCanvas(e):e,s=i.getContext("2d"),o=s.getImageData(0,0,i.width,i.height),n=o.data,a=0;a<n.length;a+=4)255===n[a]&&0===n[a+1]&&255===n[a+2]&&(n[a+3]=0);return s.putImageData(o,0,0),i}}return t.Assets=function(){function i(e){if(t.isString(e)){var i=r.getPostfix(e);return r.file_type[i]?r.file_type[i]:i}t.log.error("jaws.assets.getType: Argument not a String with "+e)}function s(s){var o=this.asset,n=o.src,h=i(o.src);try{if("json"===h){if(4!==this.readyState)return;r.data[o.src]=JSON.parse(this.responseText)}else if("image"===h){var c=r.image_to_canvas?t.imageToCanvas(o.image):o.image;r.fuchia_to_transparent&&"bmp"===r.getPostfix(o.src)&&(c=e(c)),r.data[o.src]=c}else r.data[o.src]="audio"===h&&r.can_play[r.getPostfix(o.src)]?o.audio:"video"===h&&r.can_play[r.getPostfix(o.src)]?o.video:this.response}catch(l){t.log.error("Cannot process "+n+" (Message: "+l.message+", Name: "+l.name+")"),r.data[o.src]=null}r.loaded[n]||r.load_count++,r.loaded[n]=!0,r.loading[n]=!1,a(o,!0,s)}function o(t){r.loaded[t.src]=!0,r.loading[t.src]=!1,r.load_count++,a(t,!0)}function n(t){var e=this.asset;r.error_count++,a(e,!1,t)}function a(t,e,i){var s=parseInt((r.load_count+r.error_count)/r.src_list.length*100);e?(r.onprogress&&r.onprogress(t.src,s),t.onprogress&&void 0!==i&&t.onprogress(i)):(r.onerror&&r.onerror(t.src,s),t.onerror&&void 0!==i&&t.onerror(i)),100===s&&(r.onload&&r.onload(),r.onprogress=null,r.onerror=null,r.onload=null)}if(!(this instanceof arguments.callee))return new arguments.callee;var r=this;r.loaded=[],r.loading=[],r.src_list=[],r.data=[],r.bust_cache=!1,r.image_to_canvas=!0,r.fuchia_to_transparent=!0,r.root="",r.file_type={},r.file_type.json="json",r.file_type.wav="audio",r.file_type.mp3="audio",r.file_type.ogg="audio",r.file_type.m4a="audio",r.file_type.weba="audio",r.file_type.aac="audio",r.file_type.mka="audio",r.file_type.flac="audio",r.file_type.png="image",r.file_type.jpg="image",r.file_type.jpeg="image",r.file_type.gif="image",r.file_type.bmp="image",r.file_type.tiff="image",r.file_type.mp4="video",r.file_type.webm="video",r.file_type.ogv="video",r.file_type.mkv="video",r.can_play={};try{var h=new Audio;r.can_play.wav=!!h.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),r.can_play.ogg=!!h.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),r.can_play.mp3=!!h.canPlayType("audio/mpeg;").replace(/^no$/,""),r.can_play.m4a=!!(h.canPlayType("audio/x-m4a;")||h.canPlayType("audio/aac;")).replace(/^no$/,""),r.can_play.weba=!!h.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,""),r.can_play.aac=!!h.canPlayType("audio/aac;").replace(/^no$/,""),r.can_play.mka=!!h.canPlayType("audio/x-matroska;").replace(/^no$/,""),r.can_play.flac=!!h.canPlayType("audio/x-flac;").replace(/^no$/,"")}catch(c){}try{var l=document.createElement("video");r.can_play.mp4=!!l.canPlayType("video/mp4;").replace(/^no$/,""),r.can_play.webm=!!l.canPlayType('video/webm; codecs="vorbis"').replace(/^no$/,""),r.can_play.ogv=!!l.canPlayType('video/ogg; codecs="vorbis"').replace(/^no$/,""),r.can_play.mkv=!!l.canPlayType("video/x-matroska;").replace(/^no$/,"")}catch(c){}r.length=function(){return r.src_list.length},r.setRoot=function(t){return r.root=t,r},r.get=function(e){if(t.isArray(e))return e.map(function(t){return r.data[t]});if(!t.isString(e))return void t.log.error("jaws.get: Neither String nor Array. Incorrect URL resource "+e);if("*"===e[e.length-1])for(var i=e.replace("*",""),s=0;s<r.src_list.length;s++)if(0==r.src_list[s].indexOf(i)&&r.data[r.src_list[s]])return r.data[r.src_list[s]];return r.data[e]?r.data[e]:void t.log.warn("No such asset: "+e,!0)},r.isLoading=function(e){return t.isString(e)?r.loading[e]:void t.log.error("jaws.isLoading: Argument not a String with "+e)},r.isLoaded=function(e){return t.isString(e)?r.loaded[e]:void t.log.error("jaws.isLoaded: Argument not a String with "+e)},r.getPostfix=function(e){return t.isString(e)?e.toLowerCase().match(/.+\.([^?]+)(\?|$)/)[1]:void t.log.error("jaws.assets.getPostfix: Argument not a String with "+e)},r.add=function(e){var i=arguments;1==i.length&&t.isArray(i[0])&&(i=i[0]);for(var s=0;s<i.length;s++)t.isArray(i[s])?r.add(i[s]):t.isString(i[s])?r.src_list.push(i[s]):t.log.error("jaws.assets.add: Neither String nor Array. Incorrect URL resource "+e);return r},r.loadAll=function(e){return r.load_count=0,r.error_count=0,e.onprogress&&t.isFunction(e.onprogress)&&(r.onprogress=e.onprogress),e.onerror&&t.isFunction(e.onerror)&&(r.onerror=e.onerror),e.onload&&t.isFunction(e.onload)&&(r.onload=e.onload),r.src_list.forEach(function(t){r.load(t)}),r},r.load=function(e,a){if(a||(a={}),!t.isString(e))return void t.log.error("jaws.assets.load: Argument not a String with "+e);var h={},c="";h.src=e,h.onload=a.onload,h.onerror=a.onerror,r.loading[e]=!0;var l=RegExp("^((f|ht)tp(s)?:)?//");c=l.test(e)?h.src:r.root+h.src,r.bust_cache&&(c+="?"+parseInt(1e7*Math.random()));var u=i(h.src);if("image"===u)try{h.image=new Image,h.image.asset=h,h.image.addEventListener("load",s),h.image.addEventListener("error",n),h.image.src=c}catch(d){t.log.error("Cannot load Image resource "+c+" (Message: "+d.message+", Name: "+d.name+")")}else if(r.can_play[r.getPostfix(h.src)]){if("audio"===u)try{h.audio=new Audio,h.audio.asset=h,h.audio.addEventListener("error",n),h.audio.addEventListener("canplay",s),r.data[h.src]=h.audio,h.audio.src=c,h.audio.load()}catch(d){t.log.error("Cannot load Audio resource "+c+" (Message: "+d.message+", Name: "+d.name+")")}else if("video"===u)try{h.video=document.createElement("video"),h.video.asset=h,r.data[h.src]=h.video,h.video.setAttribute("style","display:none;"),h.video.addEventListener("error",n),h.video.addEventListener("canplay",s),document.body.appendChild(h.video),h.video.src=c,h.video.load()}catch(d){t.log.error("Cannot load Video resource "+c+" (Message: "+d.message+", Name: "+d.name+")")}}else{if("audio"===u&&!r.can_play[r.getPostfix(h.src)])return o(h),r;try{var f=new XMLHttpRequest;f.asset=h,f.onreadystatechange=s,f.onerror=n,f.open("GET",c,!0),"json"!==u&&(f.responseType="blob"),f.send(null)}catch(d){t.log.error("Cannot load "+c+" (Message: "+d.message+", Name: "+d.name+")")}}return r},r.displayProgress=function(e){t.isNumber(e)&&t.context&&(t.context.save(),t.context.fillStyle="black",t.context.fillRect(0,0,t.width,t.height),t.context.fillStyle="white",t.context.strokeStyle="white",t.context.textAlign="center",t.context.strokeRect(49,t.height/2-30-1,t.width-100+2,62),t.context.fillRect(50,t.height/2-30,(t.width-100)/100*e,60),t.context.font="11px verdana",t.context.fillText("Loading... "+e+"%",t.width/2,t.height/2-35),t.context.font="11px verdana",t.context.fillStyle="#ccc",t.context.textBaseline="bottom",t.context.fillText("powered by www.jawsjs.com",t.width/2,t.height-1),t.context.restore())}},t.assets=new t.Assets,t}(jaws||{});if("undefined"!=typeof require)var jaws=require("./core.js");var jaws=function(t){function e(t){this.size=t,this.values=new Array(this.size),this.value,this.add=function(t){if(this.values.length>this.size){this.values.splice(0,1),this.value=0;for(var e=0;this.values[e];e++)this.value+=this.values[e];this.value=this.value/this.size}return this.values.push(t),this},this.get=function(){return parseInt(this.value)}}return window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){window.setTimeout(t,16.666)}}(),t.GameLoop=function(i,s,o){if(!(this instanceof arguments.callee))return new arguments.callee(i,s);this.tick_duration=0,this.fps=0,this.ticks=0;var n,a=!1,r=!1,h=this,c=new e(20);this.runtime=function(){return this.last_tick-this.first_tick},this.start=function(){t.log.info("Game loop start",!0),this.first_tick=(new Date).getTime(),this.current_tick=(new Date).getTime(),this.last_tick=(new Date).getTime(),s.setup!==!1&&i.setup&&i.setup(o),step_delay=1e3/s.fps,60==s.fps?requestAnimFrame(this.loop):n=setInterval(this.loop,step_delay)},this.loop=function(){h.current_tick=(new Date).getTime(),h.tick_duration=h.current_tick-h.last_tick,h.fps=c.add(1e3/h.tick_duration).get(),r||a||(i.update&&i.update(),i.draw&&i.draw(),h.ticks++),60!=s.fps||r||requestAnimFrame(h.loop),h.last_tick=h.current_tick},this.pause=function(){a=!0},this.unpause=function(){a=!1},this.stop=function(){n&&clearInterval(n),r=!0}},t}(jaws||{}),jaws=function(t){var e=0;return t.Rect=function(t,i,s,o){return this instanceof arguments.callee?(this.x=t,this.y=i,this.width=s,this.height=o,this.right=t+s-e,void(this.bottom=i+o-e)):new arguments.callee(t,i,s,o)},t.Rect.prototype.getPosition=function(){return[this.x,this.y]},t.Rect.prototype.move=function(t,e){return this.x+=t,this.y+=e,this.right+=t,this.bottom+=e,this},t.Rect.prototype.moveTo=function(t,i){return this.x=t,this.y=i,this.right=this.x+this.width-e,this.bottom=this.y+this.height-e,this},t.Rect.prototype.resize=function(t,i){return this.width+=t,this.height+=i,this.right=this.x+this.width-e,this.bottom=this.y+this.height-e,this},t.Rect.prototype.clone=function(){return new t.Rect(this.x,this.y,this.width,this.height)},t.Rect.prototype.shrink=function(t,i){return this.x+=t,this.y+=i,this.width-=t+t,this.height-=i+i,this.right=this.x+this.width-e,this.bottom=this.y+this.height-e,this},t.Rect.prototype.resizeTo=function(t,i){return this.width=t,this.height=i,this.right=this.x+this.width-e,this.bottom=this.y+this.height-e,this},t.Rect.prototype.draw=function(){return t.context.strokeStyle="red",t.context.strokeRect(this.x-.5,this.y-.5,this.width,this.height),this},t.Rect.prototype.collidePoint=function(t,e){return t>=this.x&&t<=this.right&&e>=this.y&&e<=this.bottom},t.Rect.prototype.collideRect=function(t){return(this.x>=t.x&&this.x<=t.right||t.x>=this.x&&t.x<=this.right)&&(this.y>=t.y&&this.y<=t.bottom||t.y>=this.y&&t.y<=this.bottom)},t.Rect.prototype.toString=function(){return"[Rect "+this.x+", "+this.y+", "+this.width+", "+this.height+"]"},t}(jaws||{});"undefined"!=typeof module&&"exports"in module&&(module.exports=jaws.Rect);var jaws=function(jaws){return jaws.Sprite=function(t){return this instanceof arguments.callee?(this.set(t),void(this.context=t.context?t.context:jaws.context)):new arguments.callee(t)},jaws.Sprite.prototype.default_options={x:0,y:0,alpha:1,angle:0,flipped:!1,anchor_x:0,anchor_y:0,image:null,image_path:null,anchor:null,scale_image:null,damping:1,scale_x:1,scale_y:1,scale:1,color:"#ddd",width:16,height:16,_constructor:null,context:null,data:null},jaws.Sprite.prototype.set=function(t){if(jaws.isString(this.image)&&(this.image_path=this.image),jaws.parseOptions(this,t,this.default_options),this.scale&&(this.scale_x=this.scale_y=this.scale),this.image&&this.setImage(this.image),this.scale_image&&this.scaleImage(this.scale_image),this.anchor&&this.setAnchor(this.anchor),!this.image&&this.color&&this.width&&this.height){var e=document.createElement("canvas"),i=e.getContext("2d");e.width=this.width,e.height=this.height,i.fillStyle=this.color,i.fillRect(0,0,this.width,this.height),this.image=e}return this.cacheOffsets(),this},jaws.Sprite.prototype.clone=function(object){var constructor=this._constructor?eval(this._constructor):this.constructor,new_sprite=new constructor(this.attributes());return new_sprite._constructor=this._constructor||this.constructor.name,new_sprite},jaws.Sprite.prototype.setImage=function(t){var e=this;return jaws.isDrawable(t)?(this.image=t,this.cacheOffsets()):(jaws.assets.isLoaded(t)?(this.image=jaws.assets.get(t),this.cacheOffsets()):(jaws.log.warn("Image '"+t+"' not preloaded with jaws.assets.add(). Image and a working sprite.rect() will be delayed."),jaws.assets.load(t,{onload:function(){e.image=jaws.assets.get(t),e.cacheOffsets()}})),this)},jaws.Sprite.prototype.stepToWhile=function(t,e,i){var s=1,o=t<this.x?-s:s,n=e<this.y?-s:s;t=parseInt(t),e=parseInt(e);for(var a=!1,r=!1;;)if(a===!1&&(this.x!=t&&(this.x+=o),i(this)||(this.x-=o,a=!0)),r===!1&&(this.y!=e&&(this.y+=n),i(this)||(this.y-=n,r=!0)),(a||this.x==t)&&(r||this.y==e))return{x:a,y:r}},jaws.Sprite.prototype.stepWhile=function(t,e,i){return this.stepToWhile(this.x+t,this.y+e,i)},jaws.Sprite.prototype.flip=function(){return this.flipped=this.flipped?!1:!0,this},jaws.Sprite.prototype.flipTo=function(t){return this.flipped=t,this},jaws.Sprite.prototype.rotate=function(t){return this.angle+=t,this},jaws.Sprite.prototype.rotateTo=function(t){return this.angle=t,this},jaws.Sprite.prototype.moveTo=function(t,e){return jaws.isArray(t)&&void 0===e&&(e=t[1],t=t[0]),this.x=t,this.y=e,this},jaws.Sprite.prototype.move=function(t,e){return jaws.isArray(t)&&void 0===e&&(e=t[1],t=t[0]),t&&(this.x+=t),e&&(this.y+=e),this},jaws.Sprite.prototype.scaleAll=function(t){return this.scale_x*=t,this.scale_y*=t,this.cacheOffsets()},jaws.Sprite.prototype.scaleTo=function(t){return this.scale_x=this.scale_y=t,this.cacheOffsets()},jaws.Sprite.prototype.scaleWidth=function(t){return this.scale_x*=t,this.cacheOffsets()},jaws.Sprite.prototype.scaleHeight=function(t){return this.scale_y*=t,this.cacheOffsets()},jaws.Sprite.prototype.setX=function(t){return this.x=t,this},jaws.Sprite.prototype.setY=function(t){return this.y=t,this},jaws.Sprite.prototype.setTop=function(t){return this.y=t+this.top_offset,this},jaws.Sprite.prototype.setBottom=function(t){return this.y=t-this.bottom_offset,this},jaws.Sprite.prototype.setLeft=function(t){return this.x=t+this.left_offset,this},jaws.Sprite.prototype.setRight=function(t){return this.x=t-this.right_offset,this},jaws.Sprite.prototype.setWidth=function(t){return this.scale_x=t/this.image.width,this.cacheOffsets()},jaws.Sprite.prototype.setHeight=function(t){return this.scale_y=t/this.image.height,this.cacheOffsets()},jaws.Sprite.prototype.resize=function(t,e){return jaws.isArray(t)&&void 0===e&&(e=t[1],t=t[0]),this.scale_x=(this.width+t)/this.image.width,this.scale_y=(this.height+e)/this.image.height,this.cacheOffsets()},jaws.Sprite.prototype.resizeTo=function(t,e){return jaws.isArray(t)&&void 0===e&&(e=t[1],t=t[0]),this.scale_x=t/this.image.width,this.scale_y=e/this.image.height,this.cacheOffsets()},jaws.Sprite.prototype.setAnchor=function(t){var e={top_left:[0,0],left_top:[0,0],center_left:[0,.5],left_center:[0,.5],bottom_left:[0,1],left_bottom:[0,1],top_center:[.5,0],center_top:[.5,0],center_center:[.5,.5],center:[.5,.5],bottom_center:[.5,1],center_bottom:[.5,1],top_right:[1,0],right_top:[1,0],center_right:[1,.5],right_center:[1,.5],bottom_right:[1,1],right_bottom:[1,1]};return(a=e[t])&&(this.anchor_x=a[0],this.anchor_y=a[1],this.image&&this.cacheOffsets()),this},jaws.Sprite.prototype.cacheOffsets=function(){return this.image?(this.width=this.image.width*this.scale_x,this.height=this.image.height*this.scale_y,this.left_offset=this.width*this.anchor_x,this.top_offset=this.height*this.anchor_y,this.right_offset=this.width*(1-this.anchor_x),this.bottom_offset=this.height*(1-this.anchor_y),this.cached_rect&&this.cached_rect.resizeTo(this.width,this.height),this):void 0},jaws.Sprite.prototype.rect=function(){return!this.cached_rect&&this.width&&(this.cached_rect=new jaws.Rect(this.x,this.y,this.width,this.height)),this.cached_rect&&this.cached_rect.moveTo(this.x-this.left_offset,this.y-this.top_offset),this.cached_rect},jaws.Sprite.prototype.draw=function(){return this.image?(this.context.save(),this.context.translate(this.x,this.y),0!=this.angle&&jaws.context.rotate(this.angle*Math.PI/180),this.flipped&&this.context.scale(-1,1),this.context.globalAlpha=this.alpha,this.context.translate(-this.left_offset,-this.top_offset),this.context.drawImage(this.image,0,0,this.width,this.height),this.context.restore(),this):this},jaws.Sprite.prototype.scaleImage=function(t){return this.image?(this.setImage(jaws.retroScaleImage(this.image,t)),this):void 0},jaws.Sprite.prototype.asCanvasContext=function(){var t=document.createElement("canvas");t.width=this.width,t.height=this.height;var e=t.getContext("2d");return jaws.context&&(e.mozImageSmoothingEnabled=jaws.context.mozImageSmoothingEnabled),e.drawImage(this.image,0,0,this.width,this.height),e},jaws.Sprite.prototype.asCanvas=function(){var t=document.createElement("canvas");t.width=this.width,t.height=this.height;var e=t.getContext("2d");return jaws.context&&(e.mozImageSmoothingEnabled=jaws.context.mozImageSmoothingEnabled),e.drawImage(this.image,0,0,this.width,this.height),t},jaws.Sprite.prototype.toString=function(){return"[Sprite "+this.x.toFixed(2)+", "+this.y.toFixed(2)+", "+this.width+", "+this.height+"]"},jaws.Sprite.prototype.attributes=function(){var t={};return t._constructor=this._constructor||"jaws.Sprite",t.x=parseFloat(this.x.toFixed(2)),t.y=parseFloat(this.y.toFixed(2)),t.image=this.image_path,t.alpha=this.alpha,t.flipped=this.flipped,t.angle=parseFloat(this.angle.toFixed(2)),t.scale_x=this.scale_x,t.scale_y=this.scale_y,t.anchor_x=this.anchor_x,t.anchor_y=this.anchor_y,null!==this.data&&(t.data=jaws.clone(this.data)),t},jaws.Sprite.parse=function(objects){function parseArray(array){array.forEach(function(data){var constructor=data._constructor?eval(data._constructor):data.constructor;if(jaws.isFunction(constructor)){jaws.log.info("Creating "+data._constructor+"("+data.toString()+")",!0);var object=new constructor(data);object._constructor=data._constructor||data.constructor.name,sprites.push(object)}})}var sprites=[];return jaws.isArray(objects)?objects.every(function(t){return t._constructor})?parseArray(objects):sprites=objects:jaws.isString(objects)&&(parseArray(JSON.parse(objects)),jaws.log.info(objects)),sprites},jaws.Sprite.prototype.toJSON=function(){return JSON.stringify(this.attributes())},jaws}(jaws||{});"undefined"!=typeof module&&"exports"in module&&(module.exports=jaws.Sprite);var jaws=function(t){function e(t,e,i,s,o){var n=document.createElement("canvas");n.width=s,n.height=o;var a=n.getContext("2d");return a.drawImage(t,e,i,s,o,0,0,n.width,n.height),n}return t.SpriteSheet=function(i){if(!(this instanceof arguments.callee))return new arguments.callee(i);if(t.parseOptions(this,i,this.default_options),t.isString(this.image)&&!i.frame_size){var s=new RegExp("_(\\d+)x(\\d+)","g"),o=s.exec(this.image);this.frame_size=[],this.frame_size[0]=parseInt(o[1]),this.frame_size[1]=parseInt(o[2])}if(this.image=t.isDrawable(this.image)?this.image:t.assets.data[this.image],this.scale_image){var n=t.isDrawable(this.image)?this.image:t.assets.get(this.image);this.frame_size[0]*=this.scale_image,this.frame_size[1]*=this.scale_image,this.image=t.retroScaleImage(n,this.scale_image)}if(this.frames=[],"down"==this.orientation)for(var a=this.offset;a<this.image.width;a+=this.frame_size[0])for(var r=0;r<this.image.height;r+=this.frame_size[1])this.frames.push(e(this.image,a,r,this.frame_size[0],this.frame_size[1]));else for(var r=this.offset;r<this.image.height;r+=this.frame_size[1])for(var a=0;a<this.image.width;a+=this.frame_size[0])this.frames.push(e(this.image,a,r,this.frame_size[0],this.frame_size[1]))},t.SpriteSheet.prototype.default_options={image:null,orientation:"down",frame_size:[32,32],offset:0,scale_image:null},t.SpriteSheet.prototype.toString=function(){return"[SpriteSheet "+this.frames.length+" frames]"},t}(jaws||{}),jaws=function(t){return t.Animation=function(e){if(!(this instanceof arguments.callee))return new arguments.callee(e);if(t.parseOptions(this,e,this.default_options),e.sprite_sheet){var i=new t.SpriteSheet({image:e.sprite_sheet,scale_image:this.scale_image,frame_size:this.frame_size,orientation:this.orientation,offset:this.offset});this.frames=i.frames,this.frame_size=i.frame_size}if(e.scale_image){var s=t.isDrawable(e.sprite_sheet)?e.sprite_sheet:t.assets.get(e.sprite_sheet);this.frame_size[0]*=e.scale_image,this.frame_size[1]*=e.scale_image,e.sprite_sheet=t.retroScaleImage(s,e.scale_image)}if(this.current_tick=(new Date).getTime(),this.last_tick=(new Date).getTime(),this.sum_tick=0,e.subsets){this.subsets={};for(subset in e.subsets)start_stop=e.subsets[subset],this.subsets[subset]=this.slice(start_stop[0],start_stop[1])}},t.Animation.prototype.default_options={frames:[],subsets:[],frame_duration:100,index:0,loop:1,bounce:0,frame_direction:1,frame_size:null,orientation:"down",on_end:null,offset:0,scale_image:null,sprite_sheet:null},t.Animation.prototype.subset=function(t){return this.subsets[t]},t.Animation.prototype.update=function(){return this.current_tick=(new Date).getTime(),this.sum_tick+=this.current_tick-this.last_tick,this.last_tick=this.current_tick,this.sum_tick>this.frame_duration&&(this.index+=this.frame_direction,this.sum_tick=0),(this.index>=this.frames.length||this.index<0)&&(this.bounce?(this.frame_direction=-this.frame_direction,this.index+=2*this.frame_direction):this.loop?this.index=this.frame_direction<0?this.frames.length-1:0:(this.index-=this.frame_direction,this.on_end&&(this.on_end(),this.on_end=null))),this
+},t.Animation.prototype.slice=function(e,i){var s={};return s.frame_duration=this.frame_duration,s.loop=this.loop,s.bounce=this.bounce,s.on_end=this.on_end,s.frame_direction=this.frame_direction,s.frames=this.frames.slice().slice(e,i),new t.Animation(s)},t.Animation.prototype.next=function(){return this.update(),this.frames[this.index]},t.Animation.prototype.atLastFrame=function(){return this.index==this.frames.length-1},t.Animation.prototype.atFirstFrame=function(){return 0==this.index},t.Animation.prototype.currentFrame=function(){return this.frames[this.index]},t.Animation.prototype.toString=function(){return"[Animation, "+this.frames.length+" frames]"},t}(jaws||{});if("undefined"!=typeof require)var jaws=require("./core.js");var jaws=function(t){function e(t,e){for(var i=function(e){return void 0!==t.isSpriteList?t.at(e):t[e]},s=[],o=new Array(e),n=0;e>n;n++)o[n]=n;for(var n=e-1,a=t.length;n>=0;a=t.length){for(s.push(o.map(i));n>=0&&o[n]===a-1;)n--,a--;if(n>=0){o[n]+=1;for(var r=n+1;e>r;r++)o[r]=o[r-1]+1;n=e-1}}return s}return t.collideOneWithOne=function(e,i){return e.radius&&i.radius&&e!==i&&t.collideCircles(e,i)?!0:e.rect&&i.rect&&e!==i&&t.collideRects(e.rect(),i.rect())?!0:!1},t.collideOneWithMany=function(e,i,s){var o=[];if(s){for(var n=0;n<i.length;n++)t.collideOneWithOne(e,i[n])&&(s(e,i[n]),o.push(i[n]));return o}return i.filter(function(i){return t.collideOneWithOne(e,i)})},t.collideManyWithMany=function(i,s,o){var n=[];return i===s?e(i,2).forEach(function(e){t.collideOneWithOne(e[0],e[1])&&(o?o(e[0],e[1]):n.push([e[0],e[1]]))}):i.forEach(function(e){s.forEach(function(i){t.collideOneWithOne(e,i)&&(o?o(e,i):n.push([e,i]))})}),n},t.collideCircles=function(e,i){return t.distanceBetween(e,i)<e.radius+i.radius},t.collideRects=function(t,e){return(t.x>=e.x&&t.x<=e.right||e.x>=t.x&&e.x<=t.right)&&(t.y>=e.y&&t.y<=e.bottom||e.y>=t.y&&e.y<=t.bottom)},t.distanceBetween=function(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))},t.collide=function(e,i,s){if((e.rect||e.radius)&&i.forEach)return t.collideOneWithMany(e,i,s).length>0;if(e.forEach&&i.forEach)return t.collideManyWithMany(e,i,s).length>0;if(e.forEach&&(i.rect||i.radius))return t.collideOneWithMany(i,e,s).length>0;if(e.rect&&i.rect||e.radius&&i.radius){var o=t.collideOneWithOne(e,i);if(!s||!o)return o;s(e,i)}},t}(jaws||{}),jaws=function(t){return t.PixelMap=function(e){return this instanceof arguments.callee?(this.options=e,this.scale=e.scale||1,this.x=e.x||0,this.y=e.y||0,e.image?(this.setContext(e.image),e.scale_image&&this.setContext(t.retroScaleImage(this.context.canvas,e.scale_image)),this.width=this.context.canvas.width*this.scale,this.height=this.context.canvas.height*this.scale):t.log.warn("PixelMap needs an image to work with"),this.named_colors=[],void this.update()):new arguments.callee(e)},t.PixelMap.prototype.setContext=function(e){var e=t.isDrawable(e)?e:t.assets.get(e);this.context=t.imageToCanvasContext(e)},t.PixelMap.prototype.update=function(t,e,i,s){if((void 0===t||0>t)&&(t=0),(void 0===e||0>e)&&(e=0),(void 0===i||i>this.width)&&(i=this.width),(void 0===s||s>this.height)&&(s=this.height),0==arguments.length)this.data=this.context.getImageData(t,e,i,s).data;else for(var o=this.context.getImageData(t,e,i,s).data,n=0,a=4*this.width,r=e*this.width*4+4*t,h=4*i,c=0;s>c;c++){for(var l=0;h>l;l++)this.data[r+l]=o[n++];r+=a}},t.PixelMap.prototype.draw=function(){t.context.drawImage(this.context.canvas,this.x,this.y,this.width,this.height)},t.PixelMap.prototype.namedColorAtRect=function(t,e){for(var i=t.x,s=t.y;i<t.right-1;i++)if(this.namedColorAt(i,s)==e||void 0===e)return this.namedColorAt(i,s);for(;s<t.bottom-1;s++)if(this.namedColorAt(i,s)==e||void 0===e)return this.namedColorAt(i,s);for(;i>t.x;i--)if(this.namedColorAt(i,s)==e||void 0===e)return this.namedColorAt(i,s);for(;s>t.y;s--)if(this.namedColorAt(i,s)==e||void 0===e)return this.namedColorAt(i,s);return!1},t.PixelMap.prototype.at=function(t,e){t=parseInt(t),e=parseInt(e),0>e&&(e=0);var i=e*this.width*4+4*t,s=this.data[i],o=this.data[i+1],n=this.data[i+2],a=this.data[i+3];return[s,o,n,a]},t.PixelMap.prototype.namedColorAt=function(t,e){for(var i=this.at(t,e),s=0;s<this.named_colors.length;s++){var o=this.named_colors[s].name,n=this.named_colors[s].color;if(n[0]==i[0]&&n[1]==i[1]&&n[2]==i[2]&&n[3]==i[3])return o}},t.PixelMap.prototype.nameColor=function(t,e){this.named_colors.push({name:e,color:t})},t}(jaws||{}),jaws=function(t){return t.Parallax=function(e){return this instanceof arguments.callee?void t.parseOptions(this,e,this.default_options):new arguments.callee(e)},t.Parallax.prototype.default_options={width:function(){return t.width},height:function(){return t.height},scale:1,repeat_x:null,repeat_y:null,camera_x:0,camera_y:0,layers:[]},t.Parallax.prototype.draw=function(){for(var t,e,i=0;i<this.layers.length;i++)for(t=this.layers[i],e=this.repeat_x?-(this.camera_x/t.damping%t.width):-(this.camera_x/t.damping),t.y=this.repeat_y?-(this.camera_y/t.damping%t.height):-(this.camera_y/t.damping),t.x=e;t.y<this.height;){for(;t.x<this.width&&(t.x+t.width>=0&&t.y+t.height>=0&&t.draw(),t.x=t.x+t.width,this.repeat_x););if(t.y=t.y+t.height,t.x=e,!this.repeat_y)break}},t.Parallax.prototype.addLayer=function(e){var i=new t.ParallaxLayer(e);i.scaleAll(this.scale),this.layers.push(i)},t.Parallax.prototype.toString=function(){return"[Parallax "+this.x+", "+this.y+". "+this.layers.length+" layers]"},t.ParallaxLayer=function(e){return this instanceof arguments.callee?(this.damping=e.damping||0,void t.Sprite.call(this,e)):new arguments.callee(e)},t.ParallaxLayer.prototype=t.Sprite.prototype,t}(jaws||{}),jaws=function(jaws){return jaws.Text=function(t){return this instanceof arguments.callee?(this.set(t),t.context&&(this.context=t.context),void(t.context||jaws.context&&(this.context=jaws.context))):new arguments.callee(t)},jaws.Text.prototype.default_options={x:0,y:0,alpha:1,angle:0,anchor_x:0,anchor_y:0,anchor:"top_left",damping:1,style:"normal",fontFace:"serif",fontSize:12,color:"black",textAlign:"start",textBaseline:"alphabetic",text:"",wordWrap:!1,width:function(){return jaws.width},height:function(){return jaws.height},shadowColor:null,shadowBlur:null,shadowOffsetX:null,shadowOffsetY:null,_constructor:null},jaws.Text.prototype.set=function(t){return jaws.parseOptions(this,t,this.default_options),this.anchor&&this.setAnchor(this.anchor),this.cacheOffsets(),this},jaws.Text.prototype.clone=function(){var constructor=this._constructor?eval(this._constructor):this.constructor,new_sprite=new constructor(this.attributes());return new_sprite._constructor=this._constructor||this.constructor.name,new_sprite},jaws.Text.prototype.rotate=function(t){return this.angle+=t,this},jaws.Text.prototype.rotateTo=function(t){return this.angle=t,this},jaws.Text.prototype.moveTo=function(t,e){return this.x=t,this.y=e,this},jaws.Text.prototype.move=function(t,e){return t&&(this.x+=t),e&&(this.y+=e),this},jaws.Text.prototype.setX=function(t){return this.x=t,this},jaws.Text.prototype.setY=function(t){return this.y=t,this},jaws.Text.prototype.setTop=function(t){return this.y=t+this.top_offset,this},jaws.Text.prototype.setBottom=function(t){return this.y=t-this.bottom_offset,this},jaws.Text.prototype.setLeft=function(t){return this.x=t+this.left_offset,this},jaws.Text.prototype.setRight=function(t){return this.x=t-this.right_offset,this},jaws.Text.prototype.setWidth=function(t){return this.width=t,this.cacheOffsets(),this},jaws.Text.prototype.setHeight=function(t){return this.height=t,this.cacheOffsets(),this},jaws.Text.prototype.resize=function(t,e){return this.width+=t,this.height+=e,this.cacheOffsets(),this},jaws.Text.prototype.resizeTo=function(t,e){return this.width=t,this.height=e,this.cacheOffsets(),this},jaws.Text.prototype.setAnchor=function(t){var e={top_left:[0,0],left_top:[0,0],center_left:[0,.5],left_center:[0,.5],bottom_left:[0,1],left_bottom:[0,1],top_center:[.5,0],center_top:[.5,0],center_center:[.5,.5],center:[.5,.5],bottom_center:[.5,1],center_bottom:[.5,1],top_right:[1,0],right_top:[1,0],center_right:[1,.5],right_center:[1,.5],bottom_right:[1,1],right_bottom:[1,1]};return e.hasOwnProperty(t)&&(this.anchor_x=e[t][0],this.anchor_y=e[t][1],this.cacheOffsets()),this},jaws.Text.prototype.cacheOffsets=function(){return this.left_offset=this.width*this.anchor_x,this.top_offset=this.height*this.anchor_y,this.right_offset=this.width*(1-this.anchor_x),this.bottom_offset=this.height*(1-this.anchor_y),this.cached_rect&&this.cached_rect.resizeTo(this.width,this.height),this},jaws.Text.prototype.rect=function(){return!this.cached_rect&&this.width&&(this.cached_rect=new jaws.Rect(this.x,this.y,this.width,this.height)),this.cached_rect&&this.cached_rect.moveTo(this.x-this.left_offset,this.y-this.top_offset),this.cached_rect},jaws.Text.prototype.draw=function(){this.context.save(),0!==this.angle&&this.context.rotate(this.angle*Math.PI/180),this.context.globalAlpha=this.alpha,this.context.translate(-this.left_offset,-this.top_offset),this.context.fillStyle=this.color,this.context.font=this.style+" "+this.fontSize+"px "+this.fontFace,this.context.textBaseline=this.textBaseline,this.context.textAlign=this.textAlign,this.shadowColor&&(this.context.shadowColor=this.shadowColor),this.shadowBlur&&(this.context.shadowBlur=this.shadowBlur),this.shadowOffsetX&&(this.context.shadowOffsetX=this.shadowOffsetX),this.shadowOffsetY&&(this.context.shadowOffsetY=this.shadowOffsetY);var t=this.y,e=this.x;if(this.wordWrap)for(var i=this.text.split(" "),s="",o=0;o<i.length;o++){var n=s+i[o]+" ",a=this.context.measureText(n);this.y<t+this.height&&(a.width>this.width?(this.context.fillText(s,this.x,this.y),s=i[o]+" ",this.y+=this.fontSize):s=n,this.context.fillText(s,this.x,this.y))}else if(this.context.measureText(this.text).width<this.width)this.context.fillText(this.text,this.x,this.y);else for(var i=this.text.split(" "),s=" ",o=0;o<i.length;o++){var n=s+i[o]+" ";this.context.measureText(n).width<Math.abs(this.width-this.x)&&(this.context.fillText(n,this.x,this.y),s=i[o]+" ",s=n)}return this.y=t,this.x=e,this.context.restore(),this},jaws.Text.prototype.asCanvasContext=function(){var t=document.createElement("canvas");t.width=this.width,t.height=this.height;var e=t.getContext("2d");e.mozImageSmoothingEnabled=jaws.context.mozImageSmoothingEnabled,this.context.fillStyle=this.color,this.context.font=this.style+this.fontSize+"px "+this.fontFace,this.context.textBaseline=this.textBaseline,this.context.textAlign=this.textAlign,this.shadowColor&&(this.context.shadowColor=this.shadowColor),this.shadowBlur&&(this.context.shadowBlur=this.shadowBlur),this.shadowOffsetX&&(this.context.shadowOffsetX=this.shadowOffsetX),this.shadowOffsetY&&(this.context.shadowOffsetY=this.shadowOffsetY);var i=this.y,s=this.x;if(this.wordWrap)for(var o=this.text.split(" "),n="",a=0;a<o.length;a++){var r=n+o[a]+" ",h=this.context.measureText(r);this.y<i+this.height&&(h.width>this.width?(this.context.fillText(n,this.x,this.y),n=o[a]+" ",this.y+=this.fontSize):n=r,this.context.fillText(n,this.x,this.y))}else if(this.context.measureText(this.text).width<this.width)this.context.fillText(this.text,this.x,this.y);else for(var o=this.text.split(" "),n=" ",a=0;a<o.length;a++){var r=n+o[a]+" ";this.context.measureText(r).width<Math.abs(this.width-this.x)&&(this.context.fillText(r,this.x,this.y),n=o[a]+" ",n=r)}return this.y=i,this.x=s,e},jaws.Text.prototype.asCanvas=function(){var t=document.createElement("canvas");t.width=this.width,t.height=this.height;var e=t.getContext("2d");e.mozImageSmoothingEnabled=jaws.context.mozImageSmoothingEnabled,this.context.fillStyle=this.color,this.context.font=this.style+this.fontSize+"px "+this.fontFace,this.context.textBaseline=this.textBaseline,this.context.textAlign=this.textAlign,this.shadowColor&&(this.context.shadowColor=this.shadowColor),this.shadowBlur&&(this.context.shadowBlur=this.shadowBlur),this.shadowOffsetX&&(this.context.shadowOffsetX=this.shadowOffsetX),this.shadowOffsetY&&(this.context.shadowOffsetY=this.shadowOffsetY);var i=this.y,s=this.x;if(this.wordWrap)for(var o=this.text.split(" "),n="",a=0;a<o.length;a++){var r=n+o[a]+" ",h=e.measureText(r);this.y<i+this.height&&(h.width>this.width?(e.fillText(n,this.x,this.y),n=o[a]+" ",this.y+=this.fontSize):n=r,e.fillText(n,this.x,this.y))}else if(e.measureText(this.text).width<this.width)this.context.fillText(this.text,this.x,this.y);else for(var o=this.text.split(" "),n=" ",a=0;a<o.length;a++){var r=n+o[a]+" ";e.measureText(r).width<Math.abs(this.width-this.x)&&(e.fillText(r,this.x,this.y),n=o[a]+" ",n=r)}return this.y=i,this.x=s,t},jaws.Text.prototype.toString=function(){return"[Text "+this.x.toFixed(2)+", "+this.y.toFixed(2)+", "+this.width+", "+this.height+"]"},jaws.Text.prototype.attributes=function(){var t=this.options;return t._constructor=this._constructor||"jaws.Text",t.x=parseFloat(this.x.toFixed(2)),t.y=parseFloat(this.y.toFixed(2)),t.text=this.text,t.alpha=this.alpha,t.angle=parseFloat(this.angle.toFixed(2)),t.anchor_x=this.anchor_x,t.anchor_y=this.anchor_y,t.style=this.style,t.fontSize=this.fontSize,t.fontFace=this.fontFace,t.color=this.color,t.textAlign=this.textAlign,t.textBaseline=this.textBaseline,t.wordWrap=this.wordWrap,t.width=this.width,t.height=this.height,t},jaws.Text.prototype.toJSON=function(){return JSON.stringify(this.attributes())},jaws}(jaws||{});if("undefined"!=typeof module&&"exports"in module&&(module.exports=jaws.Text),"undefined"!=typeof require)var jaws=require("./core.js");var jaws=function(t){return t.QuadTree=function(e){this.depth=arguments[1]||0,this.bounds=e||new t.Rect(0,0,t.width,t.height),this.nodes=[],this.objects=[]},t.QuadTree.prototype.clear=function(){this.objects=[];for(var t=0;t<this.nodes.length;t++)"undefined"!=typeof this.nodes[t]&&(this.nodes[t].clear(),delete this.nodes[t])},t.QuadTree.prototype.split=function(){var e=Math.round(this.bounds.width/2),i=Math.round(this.bounds.height/2),s=this.bounds.x,o=this.bounds.y;this.nodes[0]=new t.QuadTree(new t.Rect(s+e,o,e,i),this.depth+1),this.nodes[1]=new t.QuadTree(new t.Rect(s,o,e,i),this.depth+1),this.nodes[2]=new t.QuadTree(new t.Rect(s,o+i,e,i),this.depth+1),this.nodes[3]=new t.QuadTree(new t.Rect(s+e,o+i,e,i),this.depth+1)},t.QuadTree.prototype.getIndex=function(t){var e=-1,i=this.bounds.x+this.bounds.width/2,s=this.bounds.y+this.bounds.height/2,o=t.y<s&&t.y+t.height<s,n=t.y>s;return t.x<i&&t.x+t.width<i?o?e=1:n&&(e=2):t.x>i&&(o?e=0:n&&(e=3)),e},t.QuadTree.prototype.insert=function(t){if(t.hasOwnProperty("x")||t.hasOwnProperty("y")||t.hasOwnProperty("width")||t.hasOwnProperty("height")){if("undefined"!=typeof this.nodes[0]){var e=this.getIndex(t);if(-1!==e)return void this.nodes[e].insert(t)}this.objects.push(t),"undefined"==typeof this.nodes[0]&&this.split();for(var i=0;i<this.objects.length;){var e=this.getIndex(this.objects[i]);-1!==e?this.nodes[e].insert(this.objects.splice(i,1)[0]):i++}}},t.QuadTree.prototype.retrieve=function(t){if(t.hasOwnProperty("x")||t.hasOwnProperty("y")||t.hasOwnProperty("width")||t.hasOwnProperty("height")){var e=this.getIndex(t),i=this.objects;if("undefined"!=typeof this.nodes[0])if(-1!==e)i=i.concat(this.nodes[e].retrieve(t));else for(var s=0;s<this.nodes.length;s++)i=i.concat(this.nodes[s].retrieve(t));return i}},t.QuadTree.prototype.collide=function(e,i,s){var o=!1,n=new t.QuadTree,a=[];return e.forEach||(a.push(e),e=a),i.forEach||(a=[],a.push(i),i=a),i.forEach(function(t){n.insert(t)}),e.forEach(function(e){t.collide(e,n.retrieve(e),s)&&(o=!0)}),n.clear(),o},t}(jaws||{});"undefined"!=typeof module&&"exports"in module&&(module.exports=jaws.QuadTree),window.addEventListener("load",function(){jaws.onload&&jaws.onload()},!1);</script><script type="text/javascript">(function () {
+ return (function() {
+ var screen_x1, screen_y1;
+ screen_x1 = 240;
+ screen_y1 = 180;
+ return jaws.onload = function() {
+ var Demo, game, gameloop;
+ Demo = (function() {
+ var AiVaquita, Bubble, EvilBubble, GrumpyBubble, HappyBubble, HeroVaquita, Sprite, Vaquita, downKey, leftKey, rightKey, spaceKey, twist, upKey, _ref1;
+
+ _ref1 = jaws.keyCodes, leftKey = _ref1.left, rightKey = _ref1.right, upKey = _ref1.up, downKey = _ref1.down, spaceKey = _ref1.space;
+
+ Sprite = (function(_super) {
+ __extends(_Class, _super);
+
+ function _Class() {
+ _Class.__super__.constructor.call(this, {
+ image: this.image,
+ x: 0,
+ y: 0,
+ scale: 2
+ });
+ }
+
+ _Class.prototype.draw = function() {
+ this.flipped = this.lr >= 0;
+ this.x = (screen_x1 + this.px + this.lr) * 2;
+ this.y = (screen_y1 + this.py - this.tb) * 2;
+ return _Class.__super__.draw.call(this);
+ };
+
+ return _Class;
+
+ })(jaws.Sprite);
+
+ Bubble = (function(_super) {
+ __extends(_Class, _super);
+
+ function _Class() {
+ return _Class.__super__.constructor.apply(this, arguments);
+ }
+
+ _Class.prototype.draw = function() {
+ if (this.py < -212) {
+ this.bubbles[this.idxs] = null;
+ return;
+ }
+ return _Class.__super__.draw.call(this);
+ };
+
+ return _Class;
+
+ })(Sprite);
+
+ HappyBubble = (function(_super) {
+ __extends(_Class, _super);
+
+ function _Class() {
+ this.lr = 3;
+ this.tb = 3;
+ this.image = happybubble0;
+ _Class.__super__.constructor.call(this);
+ }
+
+ _Class.prototype.draw = function() {
+ this.py--;
+ return _Class.__super__.draw.call(this);
+ };
+
+ return _Class;
+
+ })(Bubble);
+
+ GrumpyBubble = (function(_super) {
+ __extends(_Class, _super);
+
+ function _Class() {
+ this.lr = 6;
+ this.tb = 6;
+ this.image = grumpybubble0;
+ _Class.__super__.constructor.call(this);
+ }
+
+ _Class.prototype.draw = function() {
+ this.py -= 2;
+ return _Class.__super__.draw.call(this);
+ };
+
+ return _Class;
+
+ })(Bubble);
+
+ EvilBubble = (function(_super) {
+ __extends(_Class, _super);
+
+ function _Class() {
+ this.lr = 12;
+ this.tb = 12;
+ this.image = evilbubble0;
+ _Class.__super__.constructor.call(this);
+ }
+
+ _Class.prototype.draw = function() {
+ this.py -= 2;
+ return _Class.__super__.draw.call(this);
+ };
+
+ return _Class;
+
+ })(Bubble);
+
+ twist = [pixyvaquita_twist_l, pixyvaquita_twist_r];
+
+ Vaquita = (function(_super) {
+ __extends(_Class, _super);
+
+ function _Class() {
+ this.lr = 18;
+ this.tb = 5;
+ _Class.__super__.constructor.call(this);
+ }
+
+ _Class.prototype.draw = function() {
+ if (this.vx < 0) {
+ this.lr = -18;
+ } else if (this.vx > 0) {
+ this.lr = 18;
+ }
+ return _Class.__super__.draw.call(this);
+ };
+
+ return _Class;
+
+ })(Sprite);
+
+ AiVaquita = (function(_super) {
+ __extends(_Class, _super);
+
+ function _Class() {
+ this.image = pixyvaquita;
+ this.time = 0;
+ _Class.__super__.constructor.call(this);
+ }
+
+ _Class.prototype.beat_lr = 0;
+
+ _Class.prototype.draw = function() {
+ var rx, ry, s, vx, vy, y;
+ vx = this.vx + Math.floor(Math.random() * 3) - 1;
+ vy = this.vy + Math.floor(Math.random() * 3) - 1;
+ x = this.px;
+ y = this.py;
+ rx = 0.5 * x / screen_x1;
+ ry = 0.5 * y / screen_y1;
+ if ((s = vx * vx + vy * vy * 2) > 6) {
+ vx = Math.round(vx * 0.9 - rx);
+ vy = Math.round(vy * 0.9 - ry);
+ }
+ this.px += this.vx = vx;
+ this.py += this.vy = vy;
+ if ((this.time++ % 3) === 0) {
+ if (this.image !== pixyvaquita) {
+ this.image = pixyvaquita;
+ } else if (this.vx !== 0) {
+ this.image = twist[this.beat_lr++ & 1];
+ }
+ }
+ return _Class.__super__.draw.call(this);
+ };
+
+ return _Class;
+
+ })(Vaquita);
+
+ HeroVaquita = (function(_super) {
+ __extends(_Class, _super);
+
+ function _Class() {
+ var _ref2, _ref3;
+ this.image = pixyvaquita;
+ this.time = 0;
+ _Class.__super__.constructor.call(this);
+ this.fpx = (_ref2 = this.px) != null ? _ref2 : 0;
+ this.fpy = (_ref3 = this.py) != null ? _ref3 : 0;
+ }
+
+ _Class.prototype.beat_lr = 0;
+
+ _Class.prototype.draw = function() {
+ var ax, ay, vx, vy;
+ ax = (jaws.pressed[leftKey] ? -1 : 0) + (jaws.pressed[rightKey] ? 1 : 0);
+ ay = (jaws.pressed[upKey] ? -1 : 0) + (jaws.pressed[downKey] ? 1 : 0);
+ vx = this.vx;
+ vy = this.vy;
+ if (ax * vx < 0) {
+ vx = 0;
+ } else {
+ vx += ax;
+ vx *= 0.9;
+ }
+ if (ay * vy < 0) {
+ vy = 0;
+ } else {
+ vy += ay;
+ vy *= 0.9;
+ }
+ this.vx = vx;
+ this.vy = vy;
+ this.px = (this.fpx += this.vx);
+ this.py = (this.fpy += this.vy);
+ if ((this.time++ % 3) === 0) {
+ if (this.image !== pixyvaquita) {
+ this.image = pixyvaquita;
+ } else if (vx * vx + (vy * vy / 4) > 1) {
+ this.image = twist[this.beat_lr++ & 1];
+ }
+ }
+ return _Class.__super__.draw.call(this);
+ };
+
+ return _Class;
+
+ })(Vaquita);
+
+ Demo.prototype.addVaquita = function() {
+ var angle, v;
+ angle = Math.random() * 6.28;
+ v = new AiVaquita;
+ v.vx = 0;
+ v.vy = 0;
+ v.px = Math.floor(Math.sin(angle) * 300);
+ v.py = Math.floor(Math.cos(angle) * 300);
+ v.draw();
+ return this.vaquitas.push(v);
+ };
+
+ Demo.prototype.addBubble = function() {
+ var angle, b, i, v;
+ angle = Math.random() * 6.28;
+ v = (angle * 100) & 1 ? new HappyBubble : new GrumpyBubble;
+ v.vx = 0;
+ v.vy = 0;
+ v.px = Math.floor(Math.sin(angle) * 300);
+ v.py = 200;
+ v.bubbles = b = this.bubbles;
+ if ((i = b.indexOf(null)) >= 0) {
+ b[i] = v;
+ v.idxs = i;
+ } else {
+ v.idxs = b.length;
+ b.push(v);
+ }
+ return v.draw();
+ };
+
+ function Demo(vaquitas, bubbles) {
+ this.vaquitas = vaquitas != null ? vaquitas : [];
+ this.bubbles = bubbles != null ? bubbles : [];
+ }
+
+ Demo.prototype.setup = function() {
+ var v;
+ v = new HeroVaquita;
+ v.px = 0;
+ v.py = 0;
+ v.vx = 0;
+ v.vy = 0;
+ return this.vaquitas.push(v);
+ };
+
+ Demo.prototype.draw = function() {
+ var v, _j, _k, _len1, _len2, _ref2, _ref3;
+ jaws.clear();
+ if ((!(this.gameloop.ticks & 0x7f) && this.vaquitas.length < 7) || jaws.pressed[spaceKey]) {
+ this.addVaquita();
+ }
+ if (0 === (this.gameloop.ticks & 0x7)) {
+ this.addBubble();
+ }
+ _ref2 = this.vaquitas;
+ for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
+ v = _ref2[_j];
+ v.draw();
+ }
+ _ref3 = this.bubbles;
+ for (_k = 0, _len2 = _ref3.length; _k < _len2; _k++) {
+ v = _ref3[_k];
+ if (v != null) {
+ v.draw();
+ }
+ }
+ if ((this.gameloop.ticks & 0xff) === 0xff) {
+ return fps.innerHTML = " - " + this.gameloop.fps + " fps";
+ }
+ };
+
+ return Demo;
+
+ })();
+ if (true) {
+ jaws.init();
+ jaws.setupInput();
+ game = new Demo;
+ gameloop = new jaws.GameLoop(game, {
+ fps: 24
+ });
+ return (game.gameloop = gameloop).start();
+ } else {
+ return jaws.start(Demo, {
+ fps: 25
+ });
+ }
+ };
+ })();
+ })();
+</script></body></html> \ No newline at end of file
diff --git a/SunkenMoon.html.coffee b/SunkenMoon.html.coffee
new file mode 100644
index 0000000..07c0801
--- /dev/null
+++ b/SunkenMoon.html.coffee
@@ -0,0 +1,414 @@
+# Copyright (c) 2013, 2014 Michele Bini
+
+# A game featuring a Vaquita, the smallest, most endagered marine cetacean
+
+# This program is available under the terms of the MIT License
+
+version = "0.1.105"
+
+{ htmlcup } = require 'htmlcup'
+
+htmlcup[x] = htmlcup.compileTag x for x in [ "svg", "rect", "g", "ellipse", "polygon", "line", "image", "defs", "linearGradient", "stop", "use" ]
+
+title = "Vilma, the happy Vaquita - Sunken Moon"
+
+fs = require 'fs'
+
+datauri = (t,x)-> "data:#{t};base64,#{new Buffer(fs.readFileSync(x)).toString("base64")}"
+datauripng = (x)-> datauri "image/png", x
+datauriicon = (x)-> datauri "image/x-icon", x
+
+icon = datauriicon "vaquita.ico"
+pixyvaquita = datauripng "vilma.png"
+
+frames =
+ _: pixyvaquita
+ twist_l: datauripng "vilma_twist_l.png"
+ twist_r: datauripng "vilma_twist_r.png"
+ happybubble0: datauripng "Happy-oxygen-bubble.png"
+ grumpybubble0: datauripng "Grumpy-bubble.png"
+
+gameName = "#{title} v#{version}"
+
+htmlcup.jsFile = (f)-> @script type:"text/javascript", (fs.readFileSync(f).toString())
+
+genPage = ->
+ htmlcup.html5Page ->
+ @head ->
+ @meta charset:"utf-8"
+ @link rel:"shortcut icon", href:icon
+ @title title
+ @style type: "text/css",
+ """
+ body {
+ /* background:pink; */
+ /* background: #69B2FF; */
+ /* background: #21AFF8; */
+ /* background: #0286E8; */
+ /* background: #1096EE; */
+ background:black;
+ text-align: center;
+ font-size: 22px;
+ font-family: Helvetica;
+ color:white;
+ color:rgba(255,255,255,0.9);
+ margin:0;
+ }
+ .banner {
+ border: 5px solid white;
+ border: 5px solid white rgba(255,255,255,0.9);
+ box-shadow: 0 2px 4px blue;
+ margin: 1em;
+ }
+ footer, p {
+ margin-top:0.418em;
+ margin-bottom:0.418em;
+ margin-left:auto;
+ margin-right:auto;
+ text-shadow: 0 1px 1px blue;
+ }
+ p {
+ width:22em;
+ max-width:100%;
+ }
+ a {
+ /*
+ color:rgb(200,255,255);
+ color:rgba(200,255,255,0.9);
+ */
+ color:white;
+ color:rgba(255,255,255,0.9);
+ text-decoration:none;
+ display: inline-block;
+ border: 1px solid white;
+ padding: 0 0.2em;
+ border-radius: 0.2em;
+ -moz-border-radius: 0.2em;
+ -webkit-border-radius: 0.2em;
+ -ie-border-radius: 0.2em;
+ }
+ a:hover {
+ background-color:rgba(20,70,180,1.0);
+ }
+ .petition {
+ margin:0.418em;
+ padding:0.618em;
+ }
+ .petition a {
+ font-size:127.2%;
+ box-shadow: 0 2px 4px blue;
+ margin:0.3em;
+ }
+ .page {
+ width: 100%;
+ height: 100%;
+ margin: 0;
+ border: 0;
+ }
+ .centering {
+ display: table;
+ padding: 0;
+ }
+ .centered {
+ display: table-cell;
+ vertical-align: middle;
+ text-align: center;
+ }
+ .inline-block {
+ display: inline-block;
+ }
+ .dynamic-section {
+ display: inline-block;
+ vertical-align:middle;
+ max-width:100%;
+ }
+ .flip-lr {
+ -moz-transform: scaleX(-1);
+ -o-transform: scaleX(-1);
+ -webkit-transform: scaleX(-1);
+ transform: scaleX(-1);
+ filter: FlipH;
+ -ms-filter: "FlipH";
+ }
+ image, .pixelart {
+ image-rendering:optimizeSpeed; /* Legal fallback */
+ image-rendering:-moz-crisp-edges; /* Firefox */
+ image-rendering:-o-crisp-edges; /* Opera */
+ image-rendering:-webkit-optimize-contrast; /* Safari */
+ image-rendering:optimize-contrast; /* CSS3 Proposed */
+ image-rendering:crisp-edges; /* CSS4 Proposed */
+ image-rendering:pixelated; /* CSS4 Proposed */
+ -ms-interpolation-mode:nearest-neighbor; /* IE8+ */
+ }
+ /*
+ .pixelart {
+ image-rendering: -moz-crisp-edges;
+ -ms-interpolation-mode: nearest-neighbor;
+ image-rendering: pixelated;
+ image-rendering: crisp-edges;
+ }
+ */
+ g.flipped {
+ transform:scale(-1,1);
+ }
+ .dim {
+ opacity: 0.2;
+ }
+ .dim:hover {
+ opacity: 1;
+ }
+ """
+ @body ->
+ @div class:"centering page", ->
+ @div class:"centered", ->
+ @div style:"visibility:hidden;position:absolute", ->
+ @img id:"pixyvaquita", src:pixyvaquita
+ @img id:"pixyvaquita_twist_l", src:frames.twist_l
+ @img id:"pixyvaquita_twist_r", src:frames.twist_r
+ @img id:"happybubble0", src:frames.happybubble0
+ @img id:"grumpybubble0", src:frames.grumpybubble0
+ @div style:"position:relative", ->
+ @svg id:"sea-svgroot", width:"960", height:"720", style:"position:absolute;opacity:0.9;z-index:-1000", ->
+ @defs ->
+ @linearGradient id:"grad1", x1:"0%", y1:"0%", x2:"0%", y2:"100%", ->
+ @stop offset:"0%", style:"stop-color:rgb(255,255,255);stop-opacity:1"
+ @stop offset:"25%", style:"stop-color:rgb(100,200,250);stop-opacity:1"
+ @stop offset:"50%", style:"stop-color:rgb(0,80,240);stop-opacity:1"
+ @stop offset:"75%", style:"stop-color:rgb(0,0,180);stop-opacity:1"
+ @stop offset:"100%", style:"stop-color:rgb(0,0,0);stop-opacity:1"
+ @rect x:"0", y:"0", width:"960", height:"720", fill:"url(#grad1)"
+ @canvas width:"960", height:"720", ->
+ @footer class:"dim", ->
+ @span gameName
+ @span " - "
+ @a target:"_blank", href:"index.html", "Learn about Vaquitas"
+ @span id:"fps"
+ gameObjects = null
+ @script type:"text/javascript", "gameObjects=#{JSON.stringify(gameObjects)};"
+ @script type:"text/javascript", "__hasProp = {}.hasOwnProperty; __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };"
+ @jsFile "jaws/jaws-min.js"
+ # @jsFile "jaws-assets-named.js"
+ @coffeeScript -> do ->
+ # svgroot = document.getElementById("sea-svgroot")
+
+ # reportErrors = (x)->
+ # try
+ # x()
+ # catch error
+ # try
+ # alert error.toString()
+ # catch error2
+ # alert error
+
+ screen_x1 = 240
+ screen_y1 = 180
+
+ jaws.onload = ->
+ class Demo
+ { left: leftKey, right: rightKey, up: upKey, down: downKey, space: spaceKey } = jaws.keyCodes
+ Sprite = class extends jaws.Sprite
+ # caller needs to set lr for flip center
+ constructor: ->
+ super
+ image: @image
+ x: 0
+ y: 0
+ scale: 2
+ draw: ->
+ @flipped = @lr >= 0
+ @x = (screen_x1 + @px + @lr) * 2
+ @y = (screen_y1 + @py - @tb) * 2
+ super()
+ Bubble = class extends Sprite
+ draw: ->
+ if @py < -212
+ @bubbles[@idxs] = null
+ return
+ super()
+ HappyBubble = class extends Bubble
+ constructor: ->
+ @lr = 3
+ @tb = 3
+ @image = happybubble0
+ super()
+ draw: ->
+ @py--
+ super()
+ GrumpyBubble = class extends Bubble
+ constructor: ->
+ @lr = 6
+ @tb = 6
+ @image = grumpybubble0
+ super()
+ draw: ->
+ @py -= 2
+ super()
+ EvilBubble = class extends Bubble
+ constructor: ->
+ @lr = 12
+ @tb = 12
+ @image = evilbubble0
+ super()
+ draw: ->
+ @py -= 2
+ super()
+ twist = [ pixyvaquita_twist_l, pixyvaquita_twist_r ]
+ Vaquita = class extends Sprite
+ constructor: ->
+ @lr = 18
+ @tb = 5
+ super()
+ draw: ->
+ if @vx < 0
+ @lr = - 18
+ else if @vx > 0
+ @lr = 18
+ super()
+ AiVaquita = class extends Vaquita
+ constructor: ->
+ @image = pixyvaquita
+ @time = 0
+ super()
+ beat_lr: 0
+ draw: ->
+ vx = @vx + Math.floor(Math.random()*3) - 1
+ vy = @vy + Math.floor(Math.random()*3) - 1
+ x = @px
+ y = @py
+ rx = 0.5 * x / screen_x1
+ ry = 0.5 * y / screen_y1
+ if (s = vx * vx + vy * vy * 2) > 6
+ vx = Math.round(vx * 0.9 - rx)
+ vy = Math.round(vy * 0.9 - ry)
+ @px += @vx = vx
+ @py += @vy = vy
+ if (@time++ % 3) is 0
+ if @image isnt pixyvaquita
+ @image = pixyvaquita
+ else if @vx isnt 0
+ @image = twist[@beat_lr++ & 1]
+ super()
+ HeroVaquita = class extends Vaquita
+ constructor: ->
+ @image = pixyvaquita
+ @time = 0
+ super()
+ @fpx = @px ? 0
+ @fpy = @py ? 0
+ beat_lr: 0
+ draw: ->
+ ax = (if jaws.pressed[leftKey] then -1 else 0) + (if jaws.pressed[rightKey] then 1 else 0)
+ ay = (if jaws.pressed[upKey] then -1 else 0) + (if jaws.pressed[downKey] then 1 else 0)
+ vx = @vx
+ vy = @vy
+ if ax * vx < 0
+ vx = 0
+ else
+ vx += ax
+ vx *= 0.9
+ if ay * vy < 0
+ vy = 0
+ else
+ vy += ay
+ vy *= 0.9
+ @vx = vx
+ @vy = vy
+ @px = (@fpx += @vx)
+ @py = (@fpy += @vy)
+ if (@time++ % 3) is 0
+ if @image isnt pixyvaquita
+ @image = pixyvaquita
+ else if vx * vx + (vy * vy / 4) > 1
+ @image = twist[@beat_lr++ & 1]
+ super()
+ addVaquita: ->
+ # n = v.cloneNode()
+ # n.setAttribute "opacity", "0.5"
+ # n.href.baseVal = "#_v105" if Math.random(0) > 0.5
+ # n.setAttribute "transform", ""
+ # sea.appendChild n
+ angle = Math.random() * 6.28
+ v = new AiVaquita
+ v.vx = 0
+ v.vy = 0
+ v.px = Math.floor(Math.sin(angle) * 300)
+ v.py = Math.floor(Math.cos(angle) * 300)
+ v.draw()
+ # vaquita.update()
+ @vaquitas.push v
+ addBubble: ->
+ # n = v.cloneNode()
+ # n.setAttribute "opacity", "0.5"
+ # n.href.baseVal = "#_v105" if Math.random(0) > 0.5
+ # n.setAttribute "transform", ""
+ # sea.appendChild n
+ angle = Math.random() * 6.28
+ v = if (angle * 100)&1
+ new HappyBubble
+ else
+ new GrumpyBubble
+ v.vx = 0
+ v.vy = 0
+ v.px = Math.floor(Math.sin(angle) * 300)
+ v.py = 200 # Math.floor(Math.cos(angle) * 300)
+ # vaquita.update()
+ v.bubbles = b = @bubbles
+ if (i = b.indexOf(null)) >= 0
+ b[i] = v
+ v.idxs = i
+ else
+ v.idxs = b.length
+ b.push v
+ v.draw()
+ constructor: (@vaquitas = [], @bubbles = [])->
+ setup: ->
+ v = new HeroVaquita # jaws.Sprite x:screen_x1*2, y:screen_y1*2, scale:2, image:pixyvaquita
+ v.px = 0
+ v.py = 0
+ v.vx = 0
+ v.vy = 0
+ @vaquitas.push v
+ draw: ->
+ jaws.clear()
+ @addVaquita() if (!(@gameloop.ticks & 0x7f) and @vaquitas.length < 7) or jaws.pressed[spaceKey]
+ @addBubble() if 0 is (@gameloop.ticks & 0x7)
+ v.draw() for v in @vaquitas
+ v?.draw() for v in @bubbles
+ if (@gameloop.ticks & 0xff) is 0xff
+ fps.innerHTML = " - #{@gameloop.fps} fps"
+ if true
+ jaws.init()
+ jaws.setupInput();
+ game = new Demo
+ gameloop = new jaws.GameLoop(game, { fps:24 })
+ (game.gameloop = gameloop).start()
+ else
+ jaws.start Demo, fps:25
+
+ # gameFrame = -> reportErrors ->
+ # if (time & 0xff) is 0x00 and vaquitas.length < 4
+ # addVaquita()
+ # # s += 0.001
+ # x -= vx = pressedKeys[leftKey] - pressedKeys[rightKey]
+ # y -= pressedKeys[upKey] - pressedKeys[downKey]
+ # if vx > 0
+ # scaleX = 1
+ # else if vx < 0
+ # scaleX = -1
+ # v.setAttribute("transform", "translate(#{x}, #{y}) scale(#{scaleX}, #{scaleY})")
+ # # transform = v.transform.baseVal.getItem(0)
+ # # transformMatrix.a = scaleX
+ # # transformMatrix.e = x
+ # # transformMatrix.f = y
+ # if (time % 3) is 0
+ # if currentFrame.baseVal is "#twistleft"
+ # currentFrame .baseVal = "#_"
+ # else if vx isnt 0
+ # currentFrame.baseVal = "#twistleft"
+ # # transformList.initialize(transform)
+ # vq.update() for vq in vaquitas
+ # time++
+
+ # # setInterval gameFrame, 40
+
+genPage()