summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichele Bini <michele.bini@gmail.com>2014-12-13 18:06:58 (GMT)
committerMichele Bini <michele.bini@gmail.com>2014-12-13 18:06:58 (GMT)
commit2e7c8dd511dc2883489ec4043206311886831f38 (patch)
tree94dcc98b2ed8b82de31ef3a5041d10b8bc092a42
parent7c4389514af9ca51c098364234a81b1e333d3509 (diff)
Add background, improve collision reactinos
-rw-r--r--SunkenMoon.appcache145
-rw-r--r--SunkenMoon.html250
-rw-r--r--SunkenMoon.html.coffee210
3 files changed, 527 insertions, 78 deletions
diff --git a/SunkenMoon.appcache b/SunkenMoon.appcache
index 65114e0..35cb805 100644
--- a/SunkenMoon.appcache
+++ b/SunkenMoon.appcache
@@ -472,3 +472,148 @@ NETWORK:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SunkenMoon.html b/SunkenMoon.html
index 638e9e7..c2bbb54 100644
--- a/SunkenMoon.html
+++ b/SunkenMoon.html
@@ -1,5 +1,5 @@
<!DOCTYPE html>
-<html lang="en" manifest="SunkenMoon.appcache" style="height:100%"><head><meta charset="utf-8"><meta name="viewport" content="width=480, user-scalable=no"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="mobile-web-app-capable" content="yes"><link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAIAEBAAAAEACABoBQAAJgAAACAgAAABABgAqAwAAI4FAAAoAAAAEAAAACAAAAABAAgAAAAAAAABAAAAAAAAAAAAAAABAAAAAA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eJiAfJyMhKDEtNjk0PDcxOjMxOS4tNoN5en57fHl0enZxdHRxcXRxcHRycHl1dm1qbi04OBEaHg8SHBETHRQWIBocIxwdJBweJhwfJh0gJx4gKB8gKB8gKB8gKB8gKB8gJx4fJh8gKCkoMDEuNzAuNiIsMiErMYV7fIN9foR9fnx4eXh1dndzdHZzcnl1dHhzdnZzclRUVxseJxMWIBYYIhgcIxwdJR0eJR0gJx8gKCAhKSEiKSEiKSEiKCEiKCEiKSEiKSEiKSEiKicmLycnLyAoLR8oLX10dn55e4N9fXp1dnh0dXh0dXdzcXVycnVxcnRubnBqcmFgaUFETSImLRocIxweJhwfJR4fKB4gKBwdJhweJh0fJyIkKyIkKiEjKiEjKh8hKCAiKCMkKiIkKiQlLCQlLGpkZW5tbHVycXRxcW9tbXBubm1samlpaGtpamxnaWtjbWZjbGFgaVxVXkI8RCQkLB8gKB8gKR8hKBweJh0eJx0fJxweJh8hKCEiKh8hKRwdJRwdJh8gKB4gKCIjKiIjKgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"><title>Vilma, the happy Vaquita - Sunken Moon</title></head><body style="margin:0;border:0;padding:0;height:100%;width:100%;background:black"><div style="visibility:hidden;position:absolute"><img id="pixyvaquita" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAeCAYAAABuUU38AAAFWElEQVRYw+2WX0gcVxTGv7l3Zmd2drs6aHaNW7Jd88cYDaQYI1jsQ5GSh1BCAhUsNQ/JWxT6lLKExISCQkBECoW+6IMJEknaIEKQbKXJ5iFY6mKsEhOkk6qbRTe67szs7M7szvQhydKWhibEbQn1B/M2557z3e/ecy6wxRZbbLHFFv8hZ86ccYVCIe/rxkUiEXckEnFvVh3M6wZ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CWibNdKyRtD6Fb2IadUqaMaUSGusnd9WS9T9/FfwCFcIToaBH7usAAAAASUVORK5CYII="><img id="evilbubble0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAACS0lEQVRIS8WXv08UURDHvw8NmGiBRuIVcIAdGIkVzRI7KQAL/wKohUCCf4cmGq398Q/YAAUl2W2oCATo+HFSYELUQihI4Dlf3u3d7vPt7fPY814z92PmfWbmzbydVYBWuFpKG5m3wgy9seo+efZVmgE3gqZBvQg+0LQDuKC8BG5QHiGaTSMbO1Lz8jF+3d1C98+6sQGOYHSGchOdn31iGcH5tNFf/2T03Q5kpCfUJQRTNDuGWvYB2jol6EljHy254A5wqIcRvNmBetUM0LYZhn69g2jRhlvgYqGxEy54Ahzq+wien0BJaopfTH0y7e0Gh/oRRqe30fml+FjrO7LiTbWPqWrEdfA4Kk9XUV5rhQNOsF11vdAVwqWZI8ou6Ft76HjhcqgfekUiuMn/5FYZovwG1ed2nvdDIuKsRo+NH+LyKz/bcEL5+yHUhF+WauBQ8xo8gpprZNhXzYBEUk7qlaEP+L0CNeADlky+F70BydD/B/NevwKXEbwTjxd8PL6ujmTobQXRfHvBPmd83Uhje55xLdW+YDGSx+9f60wK846vYwkwTUyJZxnLuewLsScLIJv9lsHgxK+yPfuYUNlw0CcitlY+3AJz0rCnDEbyL2mkc2JzKDb9Lkef4HxmA+sfUzeXDW4GmiggJ9wBNufMcafZUSfvKO5BP/uBaDWupdTzuE1gE3WR81achSHol7uIZCyud07Lhz0XlA61bLzlmRKQPNcHOL79HaXTFLiogZ6Vy41N23CZ9BJKmQDnvTu17BUmD2w3SjEvbX8AewkfzHulUU8AAAAASUVORK5CYII="><img id="stilla0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAEdklEQVRYR+1Wf0yUdRx+3ve9H9zvnxz3cpwd5ICFDUxdK41hW5ut5fQPg+XGNFcsN0uba26KtlYUsNF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0UgWJzgFRR4saOUgaDYPTEwtBrOtSyMZjtsbx1LqJcQEM9Mz97ytwNtVyoVKj2srA5COALt01vgeu3gP3ztu18mXE+HWKAzsLkcYk0I4o1zw1H9tbweimeo+/VyouEGQYsVgLEgFBs3IetAdVyha9u3kLneLqh1aTB4TLAXPALbm1+k3tRLfYxf27qB2PIcUPv8CNtceKi2IWHSUo9RE0MwGQWYdr4K5+b4X5YJiRYak45L4btbqeEJBJ0GnuPfp8Txy7OrGjWPFmXm1dQXx3vplMgkgp6Du4h29A4U3AyyTib3d7BU2gvXUjbUWVFCWC0F5wcXUt6bjLF/hTQZ4cUwy4YSpbec0P8uob8AGyqPNPk8QBcAAAAASUVORK5CYII="></div><div style="display:table;width:100%;max-width:100%;height:100%;margin:0;border:0;padding:0"><div style="display:table-cell;vertical-align:middle;width:100%;margin:0;border:0;padding:0;text-align:center"><div style="position:relative;display:inline-block" width="480" height="720"><canvas width="480" height="720"></canvas><header style="position:absolute;top:0;left:0;font-size:14px;width:100%;color:black"><span>Vilma, the happy Vaquita - Sunken Moon v0.1.815</span><span> - </span><a target="_blank" href="index.html">Save Vaqitas</a><div style="text-align:right" id="fps"></div></header></div></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
+<html lang="en" manifest="SunkenMoon.appcache" style="height:100%"><head><meta charset="utf-8"><meta name="viewport" content="width=480, user-scalable=no"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="mobile-web-app-capable" content="yes"><link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAIAEBAAAAEACABoBQAAJgAAACAgAAABABgAqAwAAI4FAAAoAAAAEAAAACAAAAABAAgAAAAAAAABAAAAAAAAAAAAAAABAAAAAAAAKCcrAHx1eACOipIAExUaAHGChAADAA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4tNoN5en57fHl0enZxdHRxcXRxcHRycHl1dm1qbi04OBEaHg8SHBETHRQWIBocIxwdJBweJhwfJh0gJx4gKB8gKB8gKB8gKB8gKB8gJx4fJh8gKCkoMDEuNzAuNiIsMiErMYV7fIN9foR9fnx4eXh1dndzdHZzcnl1dHhzdnZzclRUVxseJxMWIBYYIhgcIxwdJR0eJR0gJx8gKCAhKSEiKSEiKSEiKCEiKCEiKSEiKSEiKSEiKicmLycnLyAoLR8oLX10dn55e4N9fXp1dnh0dXh0dXdzcXVycnVxcnRubnBqcmFgaUFETSImLRocIxweJhwfJR4fKB4gKBwdJhweJh0fJyIkKyIkKiEjKiEjKh8hKCAiKCMkKiIkKiQlLCQlLGpkZW5tbHVycXRxcW9tbXBubm1samlpaGtpamxnaWtjbWZjbGFgaVxVXkI8RCQkLB8gKB8gKR8hKBweJh0eJx0fJxweJh8hKCEiKh8hKRwdJRwdJh8gKB4gKCIjKiIjKgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"><title>Vilma, the happy Vaquita - Sunken Moon</title></head><body style="margin:0;border:0;padding:0;height:100%;width:100%;background:black"><div style="visibility:hidden;position:absolute"><img id="pixyvaquita" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAeCAYAAABuUU38AAAFWElEQVRYw+2WX0gcVxTGv7l3Zmd2drs6aHaNW7Jd88cYDaQYI1jsQ5GSh1BCAhUsNQ/JWxT6lLKExISCQkBECoW+6IMJEknaIEKQbKXJ5iFY6mKsEhOkk6qbRTe67szs7M7szvQhydKWhibEbQn1B/M2557z3e/ecy6wxRZbbLHFFv8hZ86ccYVCIe/rxkUiEXckEnFvVh3M6wZMTk7un56eHkkkEnsJIdA0DZRSuFwum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d9WS9T9/FfwCFcIToaBH7usAAAAASUVORK5CYII="><img id="evilbubble0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAACS0lEQVRIS8WXv08UURDHvw8NmGiBRuIVcIAdGIkVzRI7KQAL/wKohUCCf4cmGq398Q/YAAUl2W2oCATo+HFSYELUQihI4Dlf3u3d7vPt7fPY814z92PmfWbmzbydVYBWuFpKG5m3wgy9seo+efZVmgE3gqZBvQg+0LQDuKC8BG5QHiGaTSMbO1Lz8jF+3d1C98+6sQGOYHSGchOdn31iGcH5tNFf/2T03Q5kpCfUJQRTNDuGWvYB2jol6EljHy254A5wqIcRvNmBetUM0LYZhn69g2jRhlvgYqGxEy54Ahzq+wien0BJaopfTH0y7e0Gh/oRRqe30fml+FjrO7LiTbWPqWrEdfA4Kk9XUV5rhQNOsF11vdAVwqWZI8ou6Ft76HjhcqgfekUiuMn/5FYZovwG1ed2nvdDIuKsRo+NH+LyKz/bcEL5+yHUhF+WauBQ8xo8gpprZNhXzYBEUk7qlaEP+L0CNeADlky+F70BydD/B/NevwKXEbwTjxd8PL6ujmTobQXRfHvBPmd83Uhje55xLdW+YDGSx+9f60wK846vYwkwTUyJZxnLuewLsScLIJv9lsHgxK+yPfuYUNlw0CcitlY+3AJz0rCnDEbyL2mkc2JzKDb9Lkef4HxmA+sfUzeXDW4GmiggJ9wBNufMcafZUSfvKO5BP/uBaDWupdTzuE1gE3WR81achSHol7uIZCyud07Lhz0XlA61bLzlmRKQPNcHOL79HaXTFLiogZ6Vy41N23CZ9BJKmQDnvTu17BUmD2w3SjEvbX8AewkfzHulUU8AAAAASUVORK5CYII="><img id="stilla0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAEdklEQVRYR+1Wf0yUdRx+3ve9H9zvnxz3cpwd5ICFDUxdK41hW5ut5fQPg+XGNFcsN0uba26KtlYUsNFsrbZ+LR1DDJubbhot0nTCEowiQVG0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l+mSLYYw7uTEIfTpgbhLLXD8OsxOgcamPE6Oqqh4GGKSu/wmwWI+3eTcpYA9RfWOPmhZIlRR54jqqp0F4uhfJl4sBMIqjBk3QFo/C2VIWozFtpx6eylrKrmTJRKVjUO5Vd2Tih+ItV1fH8d+i4tho2VwcktiuouhHzUv/Ky/2gmE4zus0Oa9CmQ3jMwesiUeSBcFcCSzpawNmnPzkpIrYVH5lNjlzrKY4sZl8OvxqY6oqT09/ea5960LAtwlgOSwS/z44pG4won/yCHwd9xPZ3im7y78YBkH9+5M8tX4/MvbXiJFeft30ka4QgOmxbQK4pQKFNBXA+la8JcLVc71QMbw1dhvLs1kBbulCFfLcP+6BHVoAXdacAAAAAElFTkSuQmCC"></div><div style="display:table;width:100%;max-width:100%;height:100%;margin:0;border:0;padding:0"><div style="display:table-cell;vertical-align:middle;width:100%;margin:0;border:0;padding:0;text-align:center"><div style="position:relative;display:inline-block" width="480" height="720"><canvas width="480" height="720"></canvas><header style="position:absolute;top:0;left:0;font-size:14px;width:100%;color:black"><span>Vilma, the happy Vaquita - Sunken Moon v0.1.955</span><span> - </span><a target="_blank" href="index.html">Save Vaqitas</a><div style="text-align:right" id="fps"></div></header></div></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, sqrt;
@@ -26,7 +26,7 @@
jaws.onload = function() {
var Demo, game, gameloop;
Demo = (function() {
- var AiVaquita, Bubble, ColorPlane, EvilBubble, GenericPlane, GrumpyBubble, HappyBubble, ParallaxPlane, SeamlessPlane, Sprite, Stilla, Vaquita, Vilma, WaterPlane, downKey, encounter, leftKey, rightKey, spaceKey, upKey, waterscape, _ref1;
+ var AiVaquita, BoundParallaxPlane, Bubble, ColorPlane, EvilBubble, GenericPlane, GrumpyBubble, HappyBubble, ParallaxPlane, ScaledImg, SeaFloor, SeamlessPlane, Sprite, Stilla, Vaquita, Vilma, WaterPlane, downKey, encounter, leftKey, rightKey, spaceKey, upKey, waterscape, _ref1;
Demo.prototype.keyCodes = (_ref1 = jaws.keyCodes, leftKey = _ref1.left, rightKey = _ref1.right, upKey = _ref1.up, downKey = _ref1.down, spaceKey = _ref1.space, _ref1);
@@ -54,10 +54,10 @@
_Class.prototype.sqrt = Math.sqrt;
_Class.prototype.collide = (function(x) {
- x.coffee = "(o)@>\n { px, py, cr } = o\n opx = o.px; opy = o.py; ocr = o.cr\n dx = px - opx\n dy = py - opy\n dc = cr + ocr\n if (d = dx * dx + dy * dy) <= dc * dc\n @py = py - 1\n return\n { sqrt } = @\n if false\n py = opy\n px = opx - dc\n else\n d = sqrt d\n if d < 0.1\n dy = -1\n d = dx * dx + dy * dy\n d = sqrt d\n d = 3 * dc / sqrt(d)\n py = opy + dy * d\n px = opx + dx * d\n @px = px | 0\n @py = py | 0\n \n ";
+ x.coffee = "(o)@>\n { px, py, cr } = o\n opx = o.px; opy = o.py; ocr = o.cr\n dx = px - opx\n dy = py - opy\n dc = cr + ocr\n if (qd = dx * dx + dy * dy) <= dc * dc\n @bumpedInto?(o, qd, dx, dy)\n o.bumpedInto?(@, qd, -dx, -dy)\n # if true\n # @lr = - @lr\n # o.lr = - o.lr\n # @px = opx\n # @py = opy\n # return\n # @py = py - 1\n # return\n # { sqrt } = @\n # if false\n # py = opy\n # px = opx - dc\n # else\n # d = sqrt d\n # if d < 0.1\n # dy = -1\n # d = dx * dx + dy * dy\n # d = sqrt d\n # d = 3 * dc / sqrt(d)\n # py = opy + dy * d\n # px = opx + dx * d\n # @px = px | 0\n # @py = py | 0\n \n ";
return x;
})(function(o) {
- var cr, d, dc, dx, dy, ocr, opx, opy, px, py, sqrt;
+ var cr, dc, dx, dy, ocr, opx, opy, px, py, qd;
px = o.px, py = o.py, cr = o.cr;
opx = o.px;
opy = o.py;
@@ -65,26 +65,11 @@
dx = px - opx;
dy = py - opy;
dc = cr + ocr;
- if ((d = dx * dx + dy * dy) <= dc * dc) {
- this.py = py - 1;
- return;
- sqrt = this.sqrt;
- if (false) {
- py = opy;
- px = opx - dc;
- } else {
- d = sqrt(d);
- if (d < 0.1) {
- dy = -1;
- d = dx * dx + dy * dy;
- d = sqrt(d);
- }
- d = 3 * dc / sqrt(d);
- py = opy + dy * d;
- px = opx + dx * d;
+ if ((qd = dx * dx + dy * dy) <= dc * dc) {
+ if (typeof this.bumpedInto === "function") {
+ this.bumpedInto(o, qd, dx, dy);
}
- this.px = px | 0;
- return this.py = py | 0;
+ return typeof o.bumpedInto === "function" ? o.bumpedInto(this, qd, -dx, -dy) : void 0;
}
});
@@ -100,8 +85,8 @@
_Class.prototype.image = happybubble0;
function _Class() {
- this.lr = 3;
- this.tb = 3;
+ this.lr = 4;
+ this.tb = 4;
_Class.__super__.constructor.call(this);
}
@@ -110,6 +95,16 @@
return _Class.__super__.draw.call(this);
};
+ _Class.prototype.bumpedInto = (function(x) {
+ x.coffee = "(o, qd, dx, dy)@>\n return if @dead\n # if dx * dx * 2 > qd\n @dead = true\n ";
+ return x;
+ })(function(o, qd, dx, dy) {
+ if (this.dead) {
+ return;
+ }
+ return this.dead = true;
+ });
+
return _Class;
})(Bubble);
@@ -120,8 +115,10 @@
_Class.prototype.image = grumpybubble0;
function _Class() {
- this.lr = 6;
- this.tb = 6;
+ this.lr = 7;
+ this.tb = 7;
+ this.cr = 8;
+ this.life = 60;
_Class.__super__.constructor.call(this);
}
@@ -130,6 +127,21 @@
return _Class.__super__.draw.call(this);
};
+ _Class.prototype.bumpedInto = (function(x) {
+ x.coffee = "(o, qd, dx, dy)@>\n return if @dead\n # if dx * dx * 2 > qd\n # @dead = true\n ovy = o.vy\n o.py -= 3 + (ovy > 0 then @life -= ovy; ovy * 2 else 0)\n @dead = true unless @life > 0\n ";
+ return x;
+ })(function(o, qd, dx, dy) {
+ var ovy;
+ if (this.dead) {
+ return;
+ }
+ ovy = o.vy;
+ o.py -= 3 + (ovy > 0 ? (this.life -= ovy, ovy * 2) : 0);
+ if (!(this.life > 0)) {
+ return this.dead = true;
+ }
+ });
+
return _Class;
})(Bubble);
@@ -140,16 +152,48 @@
_Class.prototype.image = evilbubble0;
function _Class() {
- this.lr = 12;
- this.tb = 12;
+ this.lr = 15;
+ this.tb = 15;
+ this.cr = 8;
+ this.vy_ = -8;
+ this.life = 2200;
_Class.__super__.constructor.call(this);
}
_Class.prototype.draw = function() {
- this.py -= 8;
+ var l, life;
+ l = 0;
+ this.py += this.vy_;
+ if ((life = this.life) < 2200) {
+ l = 2200 - this.life;
+ if (l > 1100) {
+ l = 2200 - l;
+ }
+ l /= 55;
+ this.vy_ = -8 - l;
+ }
return _Class.__super__.draw.call(this);
};
+ _Class.prototype.bumpedInto = (function(x) {
+ x.coffee = "(o, qd, dx, dy)@>\n return if @dead\n # if dx * dx * 2 > qd\n # @dead = true\n ovx = o.vx\n ovy = o.vy\n @life -= ovx * ovx + ovy * ovy\n @life -= 10\n o.px = @px\n o.py = @py + @vy_\n @dead = true unless @life > 0\n ";
+ return x;
+ })(function(o, qd, dx, dy) {
+ var ovx, ovy;
+ if (this.dead) {
+ return;
+ }
+ ovx = o.vx;
+ ovy = o.vy;
+ this.life -= ovx * ovx + ovy * ovy;
+ this.life -= 10;
+ o.px = this.px;
+ o.py = this.py + this.vy_;
+ if (!(this.life > 0)) {
+ return this.dead = true;
+ }
+ });
+
return _Class;
})(Bubble);
@@ -162,11 +206,25 @@
_Class.prototype.Bubble = _Class.Bubble;
function _Class() {
- this.lr = 12;
- this.tb = 12;
+ this.lr = 16;
+ this.tb = 20;
_Class.__super__.constructor.call(this);
}
+ _Class.prototype.draw = function() {
+ if (this.px * this.lr > 0) {
+ this.lr = -this.lr;
+ }
+ return _Class.__super__.draw.call(this);
+ };
+
+ _Class.prototype.bumpedInto = (function(x) {
+ x.coffee = "(o)@>\n o.dead = true\n ";
+ return x;
+ })(function(o) {
+ return o.dead = true;
+ });
+
return _Class;
})(Bubble);
@@ -177,8 +235,8 @@
_Class.prototype.twist = [pixyvaquita_twist_l, pixyvaquita_twist_r];
function _Class() {
- this.lr = 18;
- this.tb = 5;
+ this.lr = 16;
+ this.tb = 16;
_Class.__super__.constructor.call(this);
}
@@ -470,13 +528,13 @@
},
grumpybubble: {
__proto__: encounter,
- p: 1 / 90000,
+ p: 1 / 20000,
creature: GrumpyBubble,
vy: -3
},
evilbubble: {
__proto__: encounter,
- p: 1 / 180000,
+ p: 1 / 30000,
creature: EvilBubble,
vy: -8
},
@@ -598,7 +656,7 @@
Demo.prototype.GenericPlane = GenericPlane = {
document: document,
init: (function(x) {
- x.coffee = "@>\n { document } = @\n e = document.createElement \"canvas\"\n e.width = @w\n e.height = @h\n @ctx = e.getContext '2d'\n ";
+ x.coffee = "@>\n { document } = @\n e = document.createElement \"canvas\"\n e.width = @w\n e.height = @h\n @ctx = e.getContext '2d'\n\n ";
return x;
})(function() {
var document, e;
@@ -610,6 +668,39 @@
})
};
+ Demo.prototype.ScaledImg = ScaledImg = {
+ document: document,
+ scale: 2,
+ init: (function(x) {
+ x.coffee = "@>\n retroScaling = (c)->\n c.imageSmoothingEnabled = false;\n c.webkitImageSmoothingEnabled = false;\n c.mozImageSmoothingEnabled = false;\n \n { scale } = @\n { width, height } = @img\n @w = w = width * scale\n @h = h = height * scale\n c0 = e = @document.createElement \"canvas\"\n retroScaling(c0)\n e.width = w\n e.height = height\n ctx0 = e.getContext '2d'\n retroScaling(ctx0)\n ctx0.drawImage @img, 0, 0, width, height, 0, 0, w, height\n @canvas = e = @document.createElement \"canvas\"\n e.width = w\n e.height = h\n ctx = e.getContext '2d'\n retroScaling(ctx)\n @ctx = ctx.drawImage c0, 0, 0, w, height, 0, 0, w, h\n \n ";
+ return x;
+ })(function() {
+ var c0, ctx, ctx0, e, h, height, retroScaling, scale, w, width, _ref;
+ retroScaling = function(c) {
+ c.imageSmoothingEnabled = false;
+ c.webkitImageSmoothingEnabled = false;
+ return c.mozImageSmoothingEnabled = false;
+ };
+ scale = this.scale;
+ _ref = this.img, width = _ref.width, height = _ref.height;
+ this.w = w = width * scale;
+ this.h = h = height * scale;
+ c0 = e = this.document.createElement("canvas");
+ retroScaling(c0);
+ e.width = w;
+ e.height = height;
+ ctx0 = e.getContext('2d');
+ retroScaling(ctx0);
+ ctx0.drawImage(this.img, 0, 0, width, height, 0, 0, w, height);
+ this.canvas = e = this.document.createElement("canvas");
+ e.width = w;
+ e.height = h;
+ ctx = e.getContext('2d');
+ retroScaling(ctx);
+ return this.ctx = ctx.drawImage(c0, 0, 0, w, height, 0, 0, w, h);
+ })
+ };
+
Demo.prototype.ParallaxPlane = ParallaxPlane = {
__proto__: GenericPlane,
ParallaxPlaneSuper: GenericPlane,
@@ -672,6 +763,82 @@
})
};
+ Demo.prototype.BoundParallaxPlane = BoundParallaxPlane = {
+ __proto__: ParallaxPlane,
+ BoundParallaxPlaneProto: ParallaxPlane,
+ init: (function(x) {
+ x.coffee = "@>\n @BoundParallaxPlaneProto.init.call @\n @mnx = (@w - (@w >> @logscale))\n @mny = (@h - (@h >> @logscale))\n ";
+ return x;
+ })(function() {
+ this.BoundParallaxPlaneProto.init.call(this);
+ this.mnx = this.w - (this.w >> this.logscale);
+ return this.mny = this.h - (this.h >> this.logscale);
+ }),
+ frame: (function(x) {
+ x.coffee = "(t, dx, dy)@>\n { fx, fy, x, y, logscale, w, h, ctx } = @\n nfx = fx + dx\n nfy = fy + dy\n nx = nfx >> logscale\n ny = nfy >> logscale\n if nx isnt x\n { mnx } = @\n if nx >= mnx\n nx = mnx\n nfx = mnx << logscale\n else if nx < 0\n nx = 0\n nfx = 0\n @x = nx\n if ny isnt y\n { mny } = @\n if ny >= mny\n ny = mny\n nfy = mny << logscale\n else if ny < 0\n ny = 0\n nfy = 0\n @y = ny\n @fx = nfx\n @fy = nfy\n # @lower?.frame t, dx >> logscale, dy >> logscale\n { canvas } = ctx\n # @mny = 100\n t.drawImage canvas, -nx, -ny\n\n ";
+ return x;
+ })(function(t, dx, dy) {
+ var canvas, ctx, fx, fy, h, logscale, mnx, mny, nfx, nfy, nx, ny, w, x, y;
+ fx = this.fx, fy = this.fy, x = this.x, y = this.y, logscale = this.logscale, w = this.w, h = this.h, ctx = this.ctx;
+ nfx = fx + dx;
+ nfy = fy + dy;
+ nx = nfx >> logscale;
+ ny = nfy >> logscale;
+ if (nx !== x) {
+ mnx = this.mnx;
+ if (nx >= mnx) {
+ nx = mnx;
+ nfx = mnx << logscale;
+ } else if (nx < 0) {
+ nx = 0;
+ nfx = 0;
+ }
+ this.x = nx;
+ }
+ if (ny !== y) {
+ mny = this.mny;
+ if (ny >= mny) {
+ ny = mny;
+ nfy = mny << logscale;
+ } else if (ny < 0) {
+ ny = 0;
+ nfy = 0;
+ }
+ this.y = ny;
+ }
+ this.fx = nfx;
+ this.fy = nfy;
+ canvas = ctx.canvas;
+ return t.drawImage(canvas, -nx, -ny);
+ })
+ };
+
+ Demo.prototype.SeaFloor = SeaFloor = (function() {
+ var CuteluTerror;
+ return {
+ __proto__: BoundParallaxPlane,
+ SeaFloorProto: BoundParallaxPlane,
+ terror: CuteluTerror = {
+ img: cuteluterror,
+ scale: 6,
+ __proto__: ScaledImg
+ },
+ color: "#051555",
+ init: (function(x) {
+ x.coffee = "@>\n @terror.init()\n @SeaFloorProto.init.call @\n # { color, w, h } = @\n # e = @document.createElement \"canvas\"\n # e.width = w\n # e.height = h\n # @ctx = ctx = e.getContext '2d'\n { color, ctx, w, h } = @\n @color = ctx.fillStyle = color\n ctx.fillRect 0, 0, w, h\n ctx.drawImage @terror.canvas, (w - @terror.w)/2, h - @terror.h\n \n ";
+ return x;
+ })(function() {
+ var color, ctx, h, w;
+ this.terror.init();
+ this.SeaFloorProto.init.call(this);
+ color = this.color, ctx = this.ctx, w = this.w, h = this.h;
+ this.color = ctx.fillStyle = color;
+ ctx.fillRect(0, 0, w, h);
+ return ctx.drawImage(this.terror.canvas, (w - this.terror.w) / 2, h - this.terror.h);
+ })
+ };
+ })();
+
Demo.prototype.SeamlessPlane = SeamlessPlane = {
withRect: (function(x) {
x.coffee = "(rx,ry,rw,rh,cb)@>\n { w, h } = @\n if (ex = rx + rw) > w\n if (ey = ry + rh) > h\n cb rx, ry, w - rx, h - ry, 0, 0\n cb 0, ry, ex - w, h - ry, w - rx, 0\n cb rx, 0, w - rx, ey - h, 0, h - ry\n cb 0, 0, ex - w, ey - h, w - rx, h - ry\n else\n cb rx, ry, w - rx, rh, 0, 0\n cb 0, ry, ex - w, rh, w - rx, 0\n else\n if (ey = ry + rh) > h\n cb rx, ry, rw, h - ry, 0, 0\n cb rx, 0, rw, ey - h, 0, h - ry\n else\n cb rx, ry, rw, rh, 0, 0\n ";
@@ -788,8 +955,7 @@
colors: ["#000033", "#001155"],
alpha: 0.2,
lower: {
- color: "#051555",
- __proto__: ColorPlane
+ __proto__: SeaFloor
}
}
};
@@ -912,12 +1078,12 @@
};
Demo.prototype.draw = (function(x) {
- x.coffee = "@>\n { jaws, spaceKey, radx, rady, vilma, vaquitas, cameos, stilla, rad, collisions } = @\n @addVaquita() if (!(@gameloop.ticks & 0x7f) and vaquitas.length < 7) or jaws.pressed[spaceKey]\n vilma.fpx += vilma.px\n vilma.fpy += vilma.py\n vilma.move()\n { px, py } = vilma\n vilma.fpx = 0\n vilma.fpy = 0\n vilma.px = 0\n vilma.py = 0\n px = px | 0\n py = py | 0\n @bluescape.frame jaws.context, -px, -py\n collisions.a vilma\n for v in vaquitas\n x = v.px -= px\n y = v.py -= py\n v.draw()\n if (x >= -radx) and (x < radx) and (y >= -rady) and (y < rady)\n collisions.a v\n vilma.draw()\n if stilla?\n x = stilla.px -= px\n y = stilla.py -= py\n if x * x + y * y > rad * 16\n @stilla = null\n else\n stilla.draw(collisions)\n if (x >= -radx) and (x < radx) and (y >= -rady) and (y < rady)\n collisions.a stilla\n for k,v of cameos\n continue unless v?\n x = v.px -= px\n y = v.py -= py\n if (x < -radx) or (x >= radx) or (y < -rady) or (y >= rady)\n cameos[k] = null\n else\n v.draw()\n collisions.q v\n @encounters.generate(@,-radx, -rady, radx * 2, rady * 2, px, py)\n collisions.clear()\n \n if (@gameloop.ticks & 0xff) is 0xff\n fps.innerHTML = \"#{@gameloop.fps} fps\"\n ";
+ x.coffee = "@>\n { jaws, spaceKey, radx, rady, vilma, vaquitas, cameos, stilla, rad, collisions } = @\n @addVaquita() if (!(@gameloop.ticks & 0x7f) and vaquitas.length < 1) or jaws.pressed[spaceKey]\n vilma.fpx += vilma.px\n vilma.fpy += vilma.py\n vilma.move()\n { px, py } = vilma\n vilma.fpx = 0\n vilma.fpy = 0\n vilma.px = 0\n vilma.py = 0\n px = px | 0\n py = py | 0\n @bluescape.frame jaws.context, -px, -py\n collisions.a vilma\n for v in vaquitas\n x = v.px -= px\n y = v.py -= py\n v.draw()\n if (x >= -radx) and (x < radx) and (y >= -rady) and (y < rady)\n collisions.a v\n vilma.draw()\n if stilla?\n x = stilla.px -= px\n y = stilla.py -= py\n if x * x + y * y > rad * 16\n @stilla = null\n else\n stilla.draw(collisions)\n if (x >= -radx) and (x < radx) and (y >= -rady) and (y < rady)\n collisions.a stilla\n for k,v of cameos\n continue unless v?\n x = v.px -= px\n y = v.py -= py\n if v.dead or (x < -radx) or (x >= radx) or (y < -rady) or (y >= rady)\n cameos[k] = null\n else\n v.draw()\n collisions.q v\n @encounters.generate(@,-radx, -rady, radx * 2, rady * 2, px, py)\n collisions.clear()\n \n if (@gameloop.ticks & 0xff) is 0xff\n fps.innerHTML = \"#{@gameloop.fps} fps\"\n ";
return x;
})(function() {
var cameos, collisions, jaws, k, px, py, rad, radx, rady, spaceKey, stilla, v, vaquitas, vilma, x, y, _i, _len;
jaws = this.jaws, spaceKey = this.spaceKey, radx = this.radx, rady = this.rady, vilma = this.vilma, vaquitas = this.vaquitas, cameos = this.cameos, stilla = this.stilla, rad = this.rad, collisions = this.collisions;
- if ((!(this.gameloop.ticks & 0x7f) && vaquitas.length < 7) || jaws.pressed[spaceKey]) {
+ if ((!(this.gameloop.ticks & 0x7f) && vaquitas.length < 1) || jaws.pressed[spaceKey]) {
this.addVaquita();
}
vilma.fpx += vilma.px;
@@ -961,7 +1127,7 @@
}
x = v.px -= px;
y = v.py -= py;
- if ((x < -radx) || (x >= radx) || (y < -rady) || (y >= rady)) {
+ if (v.dead || (x < -radx) || (x >= radx) || (y < -rady) || (y >= rady)) {
cameos[k] = null;
} else {
v.draw();
diff --git a/SunkenMoon.html.coffee b/SunkenMoon.html.coffee
index 66a8782..2f0562e 100644
--- a/SunkenMoon.html.coffee
+++ b/SunkenMoon.html.coffee
@@ -4,7 +4,7 @@
# This program is available under the terms of the MIT License
-version = "0.1.815"
+version = "0.1.955"
{ htmlcup } = require 'htmlcup'
@@ -29,6 +29,7 @@ frames =
grumpybubble0: datauripng "Grumpy-bubble.png"
evilbubble0: datauripng "Evil-bubble.png"
stilla0: datauripng "Stilla-the-starfish.png"
+ cuteluterror: datauripng 'cutelu-terror-v3.png'
gameName = "#{title} v#{version}"
@@ -57,6 +58,7 @@ genPage = ->
@img id:"grumpybubble0", src:frames.grumpybubble0
@img id:"evilbubble0", src:frames.evilbubble0
@img id:"stilla0", src:frames.stilla0
+ @img id:"cuteluterror", src:frames.cuteluterror
@div style:"display:table;width:100%;max-width:100%;height:100%;margin:0;border:0;padding:0", ->
@div style:"display:table-cell;vertical-align:middle;width:100%;margin:0;border:0;padding:0;text-align:center", ->
@div style:"position:relative;display:inline-block", width:"#{gameAreaSize[0]*2}", height:"#{gameAreaSize[1]*2}", ->
@@ -126,65 +128,114 @@ genPage = ->
dx = px - opx
dy = py - opy
dc = cr + ocr
- if (d = dx * dx + dy * dy) <= dc * dc
- @py = py - 1
- return
- { sqrt } = @
- if false
- py = opy
- px = opx - dc
- else
- d = sqrt d
- if d < 0.1
- dy = -1
- d = dx * dx + dy * dy
- d = sqrt d
- d = 3 * dc / sqrt(d)
- py = opy + dy * d
- px = opx + dx * d
- @px = px | 0
- @py = py | 0
+ if (qd = dx * dx + dy * dy) <= dc * dc
+ @bumpedInto?(o, qd, dx, dy)
+ o.bumpedInto?(@, qd, -dx, -dy)
+ # if true
+ # @lr = - @lr
+ # o.lr = - o.lr
+ # @px = opx
+ # @py = opy
+ # return
+ # @py = py - 1
+ # return
+ # { sqrt } = @
+ # if false
+ # py = opy
+ # px = opx - dc
+ # else
+ # d = sqrt d
+ # if d < 0.1
+ # dy = -1
+ # d = dx * dx + dy * dy
+ # d = sqrt d
+ # d = 3 * dc / sqrt(d)
+ # py = opy + dy * d
+ # px = opx + dx * d
+ # @px = px | 0
+ # @py = py | 0
Bubble: Bubble = Sprite
HappyBubble: HappyBubble = class extends Bubble
image: happybubble0
constructor: ->
- @lr = 3
- @tb = 3
+ @lr = 4
+ @tb = 4
super()
draw: ->
@py--
super()
+ bumpedInto: (o, qd, dx, dy)@>
+ return if @dead
+ # if dx * dx * 2 > qd
+ @dead = true
GrumpyBubble: GrumpyBubble = class extends Bubble
image: grumpybubble0
constructor: ->
- @lr = 6
- @tb = 6
+ @lr = 7
+ @tb = 7
+ @cr = 8
+ @life = 60
super()
draw: ->
@py -= 3
super()
+ bumpedInto: (o, qd, dx, dy)@>
+ return if @dead
+ # if dx * dx * 2 > qd
+ # @dead = true
+ ovy = o.vy
+ o.py -= 3 + (ovy > 0 then @life -= ovy; ovy * 2 else 0)
+ @dead = true unless @life > 0
EvilBubble: EvilBubble = class extends Bubble
image: evilbubble0
constructor: ->
- @lr = 12
- @tb = 12
+ @lr = 15
+ @tb = 15
+ @cr = 8
+ @vy_ = -8
+ @life = 2200
super()
draw: ->
- @py -= 8
+ l = 0
+ @py += @vy_
+ if (life = @life) < 2200
+ l = 2200 - @life
+ # l -= 1100
+ # l = -l if l < 0
+ # l = (l / 20)|0
+ l = 2200 - l if l > 1100
+ l /= 55
+ @vy_ = - 8 - l
super()
+ bumpedInto: (o, qd, dx, dy)@>
+ return if @dead
+ # if dx * dx * 2 > qd
+ # @dead = true
+ ovx = o.vx
+ ovy = o.vy
+ @life -= ovx * ovx + ovy * ovy
+ @life -= 10
+ o.px = @px
+ o.py = @py + @vy_
+ @dead = true unless @life > 0
Stilla: Stilla = class extends Bubble
image: stilla0
Bubble: @Bubble
constructor: ->
- @lr = 12
- @tb = 12
+ @lr = 16
+ @tb = 20
+ super()
+ draw: ->
+ @lr = -@lr if @px * @lr > 0
super()
+ bumpedInto: (o)@>
+ o.dead = true
Vaquita: Vaquita = class extends Sprite
twist: [ pixyvaquita_twist_l, pixyvaquita_twist_r ]
constructor: ->
- @lr = 18
- @tb = 5
+ @lr = 16
+ @tb = 16
super()
draw: ->
if @vx < 0
@@ -370,12 +421,12 @@ genPage = ->
vy: -1
grumpybubble:
__proto__: encounter
- p: 1/90000
+ p: 1/20000
creature: GrumpyBubble
vy: -3
evilbubble:
__proto__: encounter
- p: 1/180000
+ p: 1/30000
creature: EvilBubble
vy: -8
stilla:
@@ -439,6 +490,34 @@ genPage = ->
e.width = @w
e.height = @h
@ctx = e.getContext '2d'
+
+ ScaledImg: ScaledImg =
+ document: document
+ scale: 2
+ init: @>
+ retroScaling = (c)->
+ c.imageSmoothingEnabled = false;
+ c.webkitImageSmoothingEnabled = false;
+ c.mozImageSmoothingEnabled = false;
+
+ { scale } = @
+ { width, height } = @img
+ @w = w = width * scale
+ @h = h = height * scale
+ c0 = e = @document.createElement "canvas"
+ retroScaling(c0)
+ e.width = w
+ e.height = height
+ ctx0 = e.getContext '2d'
+ retroScaling(ctx0)
+ ctx0.drawImage @img, 0, 0, width, height, 0, 0, w, height
+ @canvas = e = @document.createElement "canvas"
+ e.width = w
+ e.height = h
+ ctx = e.getContext '2d'
+ retroScaling(ctx)
+ @ctx = ctx.drawImage c0, 0, 0, w, height, 0, 0, w, h
+
ParallaxPlane: ParallaxPlane =
__proto__: GenericPlane
ParallaxPlaneSuper: GenericPlane
@@ -481,6 +560,65 @@ genPage = ->
init: @>
@lower?.init()
@ParallaxPlaneSuper.init.call @
+ BoundParallaxPlane: BoundParallaxPlane =
+ __proto__: ParallaxPlane
+ BoundParallaxPlaneProto: ParallaxPlane
+ init: @>
+ @BoundParallaxPlaneProto.init.call @
+ @mnx = (@w - (@w >> @logscale))
+ @mny = (@h - (@h >> @logscale))
+ frame: (t, dx, dy)@>
+ { fx, fy, x, y, logscale, w, h, ctx } = @
+ nfx = fx + dx
+ nfy = fy + dy
+ nx = nfx >> logscale
+ ny = nfy >> logscale
+ if nx isnt x
+ { mnx } = @
+ if nx >= mnx
+ nx = mnx
+ nfx = mnx << logscale
+ else if nx < 0
+ nx = 0
+ nfx = 0
+ @x = nx
+ if ny isnt y
+ { mny } = @
+ if ny >= mny
+ ny = mny
+ nfy = mny << logscale
+ else if ny < 0
+ ny = 0
+ nfy = 0
+ @y = ny
+ @fx = nfx
+ @fy = nfy
+ # @lower?.frame t, dx >> logscale, dy >> logscale
+ { canvas } = ctx
+ # @mny = 100
+ t.drawImage canvas, -nx, -ny
+
+ SeaFloor: SeaFloor = do->
+ __proto__: BoundParallaxPlane
+ SeaFloorProto: BoundParallaxPlane
+ terror: CuteluTerror =
+ img: cuteluterror
+ scale: 6
+ __proto__: ScaledImg
+ color: "#051555"
+ init: @>
+ @terror.init()
+ @SeaFloorProto.init.call @
+ # { color, w, h } = @
+ # e = @document.createElement "canvas"
+ # e.width = w
+ # e.height = h
+ # @ctx = ctx = e.getContext '2d'
+ { color, ctx, w, h } = @
+ @color = ctx.fillStyle = color
+ ctx.fillRect 0, 0, w, h
+ ctx.drawImage @terror.canvas, (w - @terror.w)/2, h - @terror.h
+
SeamlessPlane: SeamlessPlane =
withRect: (rx,ry,rw,rh,cb)@>
{ w, h } = @
@@ -500,6 +638,7 @@ genPage = ->
else
cb rx, ry, rw, rh, 0, 0
__proto__: ParallaxPlane
+
WaterPlane: WaterPlane = do->
waterscapeSuper: waterscapeSuper = SeamlessPlane
__proto__: waterscapeSuper
@@ -597,8 +736,7 @@ genPage = ->
colors: [ "#000033", "#001155" ]
alpha: 0.2
lower:
- color: "#051555"
- __proto__: ColorPlane
+ __proto__: SeaFloor
bluescape:
__proto__: SeamlessPlane
bluescapeSuper: SeamlessPlane
@@ -722,7 +860,7 @@ genPage = ->
@l = [ ] # List of collisions targets
draw: @>
{ jaws, spaceKey, radx, rady, vilma, vaquitas, cameos, stilla, rad, collisions } = @
- @addVaquita() if (!(@gameloop.ticks & 0x7f) and vaquitas.length < 7) or jaws.pressed[spaceKey]
+ @addVaquita() if (!(@gameloop.ticks & 0x7f) and vaquitas.length < 1) or jaws.pressed[spaceKey]
vilma.fpx += vilma.px
vilma.fpy += vilma.py
vilma.move()
@@ -755,7 +893,7 @@ genPage = ->
continue unless v?
x = v.px -= px
y = v.py -= py
- if (x < -radx) or (x >= radx) or (y < -rady) or (y >= rady)
+ if v.dead or (x < -radx) or (x >= radx) or (y < -rady) or (y >= rady)
cameos[k] = null
else
v.draw()