-
Notifications
You must be signed in to change notification settings - Fork 1
/
mobile.html
88 lines (78 loc) · 111 KB
/
mobile.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<!DOCTYPE html> <html> <head><script src = "http://code.jquery.com/jquery-2.0.3.min.js"></script>
<script src = "virtualpad/pep.js"></script>
<script>
$(document).ready(function(){
$("#gamecontrols").pep({
useCSSTranslation: false,
constrainTo: "window"
});
$(".control").on("touchend click",function(){
var k = $(this).attr("id").split("_");
var keyPressed = parseInt(k[1]);
javascript:checkKey({
keyCode:keyPressed
}, true);
})
});
</script>
<style>
#gamecontrols{
width:264px;
position:absolute;
top:50px;
left:50px;
opacity:0.4;
filter:alpha(opacity=40);
}
.control{
border:1px solid #777777;
margin:3px;
background-color:#444444;
width:80px;
height:80px;
float:left;
}
.empty{
border:1px solid transparent;
margin:3px;
width:80px;
height:80px;
float:left;
}
.up{
background-image: url('virtualpad/up.png');
}
.left{
background-image: url('virtualpad/left.png');
}
.right{
background-image: url('virtualpad/right.png');
}
.down{
background-image: url('virtualpad/down.png');
}
.action{
background-image: url('virtualpad/action.png');
}
.undo{
background-image: url('virtualpad/undo.png');
}
.restart{
background-image: url('virtualpad/restart.png');
}
.dragme{
background-image: url('virtualpad/dragme.png');
}
</style>
<title>BLOCK DUDE</title> <style> body{ background-color:black;font-family:"Courier New", Courier, monospace }#gameCanvas{ position:absolute;top:0px;left:0px;width:100%;height:100%;bottom:0px;right:0px;border:0px;background-color:black;}h1{ color:lightblue;font-weight:normal;}a{ color:lightblue;}.title{ background-color:none;text-align:center;font-size:100%;float:center;color:gray;position:absolute;left:10%;right:10%;top:0%;height:10%;}.footer{ background-color:none;text-align:center;float:center;color:white;position:absolute;margin-top:10px;left:10%;right:10%;top:90%;bottom:10%;}.gameContainer{ background-color:none;position:absolute;left:10%;right:10%;top:70px;bottom:70px;}</style> </head> <body style="zoom: ;"> <div class="title"><h1>BLOCK DUDE</h1></div> <div class="gameContainer"> <canvas id="gameCanvas" onmousemove="mouseMove(event)" onmouseout="mouseOut()" onkeydown="keyDown()"></canvas> </div> <div class="footer"> <a href="index.html">Non-mobile version</a> - <a href="//github.com/oxguy3/blockdude">GitHub repo</a><br /><br />Made by <a href="http://oxguy3.github.io">Hayden Schiff</a> </div> <script>var unitTesting=!1,curlevel=0,levelEditorOpened=!1;localStorage[document.URL]!==undefined&&(curlevel=localStorage[document.URL]);var verbose_logging=!1,quittingTitleScreen=!1,quittingMessageScreen=!1,deltatime=17,timer=0,repeatinterval=150,autotick=0,autotickinterval=0,winning=!1,againing=!1,againinterval=150,oldflickscreendat=[],keybuffer=[],messageselected=!1,textImages={},initLevel={width:5,height:5,layerCount:2,dat:[1,3,3,1,1,2,2,3,3,1,2,1,2,2,3,3,1,1,2,2,3,2,1,3,2,1,3,2,1,3,1,3,3,1,1,2,2,3,3,1,2,1,2,2,3,3,1,1,2,2],movementMask:[1,3,3,1,1,2,2,3,3,1,2,1,2,2,3,3,1,1,2,2,3,2,1,3,2,1,3,2,1,3,1,3,3,1,1,2,2,3,3,1,2,1,2,2,3,3,1,1,2,2],rigidGroupIndexMask:[],rigidMovementAppliedMask:[],bannedGroup:[],colCellContents:[],rowCellContents:[]},level=initLevel </script> <script>function stripTags(a){var b=document.createElement("div");b.innerHTML=a;var c=b.textContent||b.innerText||"";return c}function consolePrint(a){}function consoleError(a,b){var c=document.getElementById("errormessage");a=stripTags(a),c.innerHTML+=a+"<br>"}function logErrorNoLine(a){var b=document.getElementById("errormessage");a=stripTags(a),b.innerHTML+=a+"<br>"}function logBetaMessage(a){var b=document.getElementById("errormessage");a=stripTags(a),b.innerHTML+=a+"<br>"}var canSetHTMLColors=!0,canDump=!1,canOpenEditor=!1,canYoutube=!0 </script> <script>var font={a:[[0,0,0,0,0],[0,1,1,1,0],[1,0,0,1,0],[1,0,0,1,0],[0,1,1,1,0]],b:[[1,0,0,0,0],[1,0,0,0,0],[1,1,1,0,0],[1,0,0,1,0],[0,1,1,0,0]],c:[[0,0,0,0,0],[0,1,1,1,0],[1,0,0,0,0],[1,0,0,0,0],[0,1,1,1,0]],d:[[0,0,0,1,0],[0,0,0,1,0],[0,1,1,1,0],[1,0,0,1,0],[0,1,1,0,0]],e:[[0,1,1,0,0],[1,0,0,1,0],[1,1,1,0,0],[1,0,0,0,0],[0,1,1,0,0]],f:[[0,0,0,0,0],[0,0,1,1,0],[0,1,0,0,0],[1,1,1,0,0],[0,1,0,0,0]],g:[[0,1,1,0,0],[1,0,0,1,0],[0,1,1,1,0],[0,0,0,1,0],[0,1,1,0,0]],h:[[1,0,0,0,0],[1,0,0,0,0],[1,1,1,0,0],[1,0,0,1,0],[1,0,0,1,0]],i:[[0,0,1,0,0],[0,0,0,0,0],[0,1,1,0,0],[0,0,1,0,0],[0,1,1,1,0]],j:[[0,0,1,0,0],[0,0,0,0,0],[0,0,1,0,0],[1,0,1,0,0],[0,1,0,0,0]],k:[[1,0,0,0,0],[1,0,0,1,0],[1,1,1,0,0],[1,0,0,1,0],[1,0,0,1,0]],l:[[1,0,0,0,0],[1,0,0,0,0],[1,0,0,0,0],[1,0,0,1,0],[0,1,1,0,0]],m:[[0,0,0,0,0],[0,1,0,1,0],[1,0,1,0,1],[1,0,1,0,1],[1,0,1,0,1]],n:[[0,0,0,0,0],[0,1,1,0,0],[1,0,0,1,0],[1,0,0,1,0],[1,0,0,1,0]],o:[[0,0,0,0,0],[0,1,1,0,0],[1,0,0,1,0],[1,0,0,1,0],[0,1,1,0,0]],p:[[0,0,0,0,0],[0,1,1,0,0],[1,0,0,1,0],[1,1,1,0,0],[1,0,0,0,0]],q:[[0,0,0,0,0],[0,1,1,0,0],[1,0,0,1,0],[0,1,1,1,0],[0,0,0,1,0]],r:[[0,0,0,0,0],[0,1,1,1,0],[1,0,0,0,0],[1,0,0,0,0],[1,0,0,0,0]],s:[[0,1,1,1,0],[1,0,0,0,0],[0,1,1,0,0],[0,0,0,1,0],[1,1,1,0,0]],t:[[0,1,0,0,0],[1,1,1,0,0],[0,1,0,0,0],[0,1,0,0,1],[0,0,1,1,0]],u:[[0,0,0,0,0],[1,0,0,1,0],[1,0,0,1,0],[1,0,0,1,0],[1,1,1,0,0]],v:[[0,0,0,0,0],[1,0,0,1,0],[1,0,1,0,0],[1,1,0,0,0],[1,0,0,0,0]],w:[[0,0,0,0,0],[1,0,1,0,1],[1,0,1,0,1],[1,0,1,0,1],[0,1,0,1,0]],x:[[0,0,0,0,0],[1,0,0,1,0],[0,1,1,0,0],[0,1,1,0,0],[1,0,0,1,0]],y:[[1,0,0,1,0],[1,0,0,1,0],[0,1,1,1,0],[0,0,0,1,0],[1,1,1,0,0]],z:[[0,0,0,0,0],[1,1,1,1,0],[0,0,1,0,0],[0,1,0,0,0],[1,1,1,1,0]],A:[[1,1,1,1,1],[1,0,0,0,1],[1,1,1,1,1],[1,0,0,0,1],[1,0,0,0,1]],B:[[1,1,1,1,0],[1,0,0,0,1],[1,1,1,1,0],[1,0,0,0,1],[1,1,1,1,0]],C:[[1,1,1,1,1],[1,0,0,0,0],[1,0,0,0,0],[1,0,0,0,0],[1,1,1,1,1]],D:[[1,1,1,1,0],[1,0,0,0,1],[1,0,0,0,1],[1,0,0,0,1],[1,1,1,1,0]],E:[[1,1,1,1,1],[1,0,0,0,0],[1,1,1,1,1],[1,0,0,0,0],[1,1,1,1,1]],F:[[1,1,1,1,1],[1,0,0,0,0],[1,1,1,1,1],[1,0,0,0,0],[1,0,0,0,0]],G:[[0,1,1,1,1],[1,0,0,0,0],[1,0,0,1,1],[1,0,0,0,1],[0,1,1,1,1]],H:[[1,0,0,0,1],[1,0,0,0,1],[1,1,1,1,1],[1,0,0,0,1],[1,0,0,0,1]],I:[[1,1,1,1,1],[0,0,1,0,0],[0,0,1,0,0],[0,0,1,0,0],[1,1,1,1,1]],J:[[1,1,1,1,1],[0,0,1,0,0],[0,0,1,0,0],[0,0,1,0,0],[1,1,1,0,0]],K:[[1,0,0,0,1],[1,0,1,1,0],[1,1,0,0,0],[1,0,1,1,0],[1,0,0,0,1]],L:[[1,0,0,0,0],[1,0,0,0,0],[1,0,0,0,0],[1,0,0,0,0],[1,1,1,1,1]],M:[[1,1,1,1,1],[1,0,1,0,1],[1,0,1,0,1],[1,0,1,0,1],[1,0,1,0,1]],N:[[1,0,0,0,1],[1,1,0,0,1],[1,0,1,0,1],[1,0,0,1,1],[1,0,0,0,1]],O:[[1,1,1,1,1],[1,0,0,0,1],[1,0,0,0,1],[1,0,0,0,1],[1,1,1,1,1]],P:[[1,1,1,1,1],[1,0,0,0,1],[1,1,1,1,1],[1,0,0,0,0],[1,0,0,0,0]],Q:[[1,1,1,1,1],[1,0,0,0,1],[1,1,1,1,1],[0,0,0,0,1],[0,0,0,0,1]],R:[[1,1,1,1,0],[1,0,0,0,1],[1,1,1,1,0],[1,0,0,0,1],[1,0,0,0,1]],S:[[0,1,1,1,1],[1,0,0,0,0],[0,1,1,1,0],[0,0,0,0,1],[1,1,1,1,0]],T:[[1,1,1,1,1],[0,0,1,0,0],[0,0,1,0,0],[0,0,1,0,0],[0,0,1,0,0]],U:[[1,0,0,0,1],[1,0,0,0,1],[1,0,0,0,1],[1,0,0,0,1],[1,1,1,1,1]],V:[[1,0,0,0,1],[0,1,0,1,0],[0,1,0,1,0],[0,0,1,0,0],[0,0,1,0,0]],W:[[1,0,1,0,1],[1,0,1,0,1],[1,0,1,0,1],[1,0,1,0,1],[0,1,0,1,0]],X:[[1,0,0,0,1],[0,1,0,1,0],[0,0,1,0,0],[0,1,0,1,0],[1,0,0,0,1]],Y:[[1,0,0,0,1],[1,0,0,0,1],[1,1,1,1,1],[0,0,1,0,0],[0,0,1,0,0]],Z:[[1,1,1,1,1],[0,0,0,1,0],[0,0,1,0,0],[0,1,0,0,0],[1,1,1,1,1]],0:[[1,1,1,1,1],[1,0,0,1,1],[1,0,1,0,1],[1,1,0,0,1],[1,1,1,1,1]],1:[[1,1,1,0,0],[0,0,1,0,0],[0,0,1,0,0],[0,0,1,0,0],[1,1,1,1,1]],2:[[1,1,1,1,1],[0,0,0,0,1],[1,1,1,1,1],[1,0,0,0,0],[1,1,1,1,1]],3:[[1,1,1,1,0],[0,0,0,0,1],[0,0,1,1,0],[0,0,0,0,1],[1,1,1,1,0]],4:[[1,0,0,0,0],[1,0,0,0,0],[1,0,0,1,0],[1,1,1,1,1],[0,0,0,1,0]],5:[[1,1,1,1,1],[1,0,0,0,0],[1,1,1,1,0],[0,0,0,0,1],[1,1,1,1,0]],6:[[0,1,1,1,0],[1,0,0,0,0],[1,1,1,1,0],[1,0,0,0,1],[0,1,1,1,0]],7:[[1,1,1,1,1],[0,0,0,0,1],[0,0,0,1,0],[0,0,1,0,0],[0,1,0,0,0]],8:[[0,1,1,1,0],[1,0,0,0,1],[0,1,1,1,0],[1,0,0,0,1],[0,1,1,1,0]],9:[[0,1,1,1,0],[1,0,0,0,1],[0,1,1,1,1],[0,0,0,0,1],[0,1,1,1,0]],".":[[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,1,0,0]],",":[[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,1,0,0],[0,1,1,0,0]],";":[[0,0,0,0,0],[0,0,1,0,0],[0,0,0,0,0],[0,0,1,0,0],[0,1,1,0,0]],":":[[0,0,0,0,0],[0,0,1,0,0],[0,0,0,0,0],[0,0,1,0,0],[0,0,0,0,0]],"?":[[0,1,1,1,0],[1,0,0,0,1],[0,0,1,1,0],[0,0,1,0,0],[0,0,1,0,0]],"!":[[0,0,1,0,0],[0,0,1,0,0],[0,0,1,0,0],[0,0,0,0,0],[0,0,1,0,0]],"@":[[0,1,1,1,0],[1,0,0,0,1],[1,0,1,1,1],[1,0,0,0,0],[0,1,1,1,0]],"£":[[0,1,1,1,0],[0,1,0,0,1],[1,1,1,0,0],[0,1,0,0,0],[1,1,1,1,1]],$:[[0,1,1,1,1],[1,0,1,0,0],[0,1,1,1,0],[0,0,1,0,1],[1,1,1,1,0]],"%":[[1,1,0,0,1],[1,1,0,1,0],[0,0,1,0,0],[0,1,0,1,1],[1,0,0,1,1]],"^":[[0,0,1,0,0],[0,1,0,1,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0]],"&":[[0,1,1,0,0],[1,0,0,0,0],[0,1,0,1,1],[1,0,0,1,0],[0,1,1,0,0]],"*":[[0,1,0,1,0],[0,0,1,0,0],[0,1,0,1,0],[0,0,0,0,0],[0,0,0,0,0]],"(":[[0,0,0,1,0],[0,0,1,0,0],[0,0,1,0,0],[0,0,1,0,0],[0,0,0,1,0]],")":[[0,1,0,0,0],[0,0,1,0,0],[0,0,1,0,0],[0,0,1,0,0],[0,1,0,0,0]],"+":[[0,0,1,0,0],[0,0,1,0,0],[1,1,1,1,1],[0,0,1,0,0],[0,0,1,0,0]],"-":[[0,0,0,0,0],[0,0,0,0,0],[0,1,1,1,0],[0,0,0,0,0],[0,0,0,0,0]],_:[[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[1,1,1,1,1]],"=":[[0,0,0,0,0],[1,1,1,1,1],[0,0,0,0,0],[1,1,1,1,1],[0,0,0,0,0]]," ":[[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0]],"{":[[0,0,1,1,0],[0,0,1,0,0],[0,1,1,0,0],[0,0,1,0,0],[0,0,1,1,0]],"}":[[0,1,1,0,0],[0,0,1,0,0],[0,0,1,1,0],[0,0,1,0,0],[0,1,1,0,0]],"[":[[0,0,1,1,0],[0,0,1,0,0],[0,0,1,0,0],[0,0,1,0,0],[0,0,1,1,0]],"]":[[0,1,1,0,0],[0,0,1,0,0],[0,0,1,0,0],[0,0,1,0,0],[0,1,1,0,0]],"'":[[0,0,1,0,0],[0,0,1,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0]],'"':[[0,1,0,1,0],[0,1,0,1,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0]],"/":[[0,0,0,0,1],[0,0,0,1,0],[0,0,1,0,0],[0,1,0,0,0],[1,0,0,0,0]],"\\":[[1,0,0,0,0],[0,1,0,0,0],[0,0,1,0,0],[0,0,0,1,0],[0,0,0,0,1]],"|":[[0,0,1,0,0],[0,0,1,0,0],[0,0,1,0,0],[0,0,1,0,0],[0,0,1,0,0]],"<":[[0,0,0,1,0],[0,0,1,0,0],[0,1,0,0,0],[0,0,1,0,0],[0,0,0,1,0]],">":[[0,1,0,0,0],[0,0,1,0,0],[0,0,0,1,0],[0,0,1,0,0],[0,1,0,0,0]],"~":[[0,0,0,0,0],[0,1,0,0,0],[1,0,1,0,1],[0,0,0,1,0],[0,0,0,0,0]],"`":[[0,1,0,0,0],[0,0,1,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0]],"#":[[0,1,0,1,0],[1,1,1,1,1],[0,1,0,1,0],[1,1,1,1,1],[0,1,0,1,0]]} </script> <script>function RC4(a){this.s=new Array(256),this.i=0,this.j=0;for(var b=0;b<256;b++)this.s[b]=b;a&&this.mix(a)}function RNG(a){a==null?a=(Math.random()+Date.now()).toString():typeof a=="function"?(this.uniform=a,this.nextByte=function(){return~~(this.uniform()*256)},a=null):Object.prototype.toString.call(a)!=="[object String]"&&(a=JSON.stringify(a)),this._normal=null,a?this._state=new RC4(a):this._state=null}String.prototype.getBytes=function(){var a=[];for(var b=0;b<this.length;b++){var c=this.charCodeAt(b),d=[];do d.push(c&255),c>>=8;while(c>0);a=a.concat(d.reverse())}return a},RC4.prototype._swap=function(a,b){var c=this.s[a];this.s[a]=this.s[b],this.s[b]=c},RC4.prototype.mix=function(a){var b=a.getBytes(),c=0;for(var d=0;d<this.s.length;d++)c+=this.s[d]+b[d%b.length],c%=256,this._swap(d,c)},RC4.prototype.next=function(){return this.i=(this.i+1)%256,this.j=(this.j+this.s[this.i])%256,this._swap(this.i,this.j),this.s[(this.s[this.i]+this.s[this.j])%256]},RNG.prototype.nextByte=function(){return this._state.next()},RNG.prototype.uniform=function(){var a=7,b=0;for(var c=0;c<a;c++)b*=256,b+=this.nextByte();return b/(Math.pow(2,a*8)-1)},RNG.prototype.random=function(a,b){return a==null?this.uniform():(b==null&&(b=a,a=0),a+Math.floor(this.uniform()*(b-a)))},RNG.prototype.normal=function(){if(this._normal!==null){var a=this._normal;return this._normal=null,a}var b=this.uniform()||Math.pow(2,-53),c=this.uniform();return this._normal=Math.sqrt(-2*Math.log(b))*Math.sin(2*Math.PI*c),Math.sqrt(-2*Math.log(b))*Math.cos(2*Math.PI*c)},RNG.prototype.exponential=function(){return-Math.log(this.uniform()||Math.pow(2,-53))},RNG.prototype.poisson=function(a){var b=Math.exp(-(a||1)),c=0,d=1;do c++,d*=this.uniform();while(d>b);return c-1},RNG.prototype.gamma=function(a){var b=(a<1?1+a:a)-1/3,c=1/Math.sqrt(9*b);do{do var d=this.normal(),e=Math.pow(c*d+1,3);while(e<=0);var f=this.uniform(),g=Math.pow(d,2)}while(f>=1-.0331*g*g&&Math.log(f)>=.5*g+b*(1-e+Math.log(e)));return a<1?b*e*Math.exp(this.exponential()/-a):b*e},RNG.roller=function(a,b){var c=a.split(/(\d+)?d(\d+)([+-]\d+)?/).slice(1),d=parseFloat(c[0])||1,e=parseFloat(c[1]),f=parseFloat(c[2])||0;return b=b||new RNG,function(){var a=d+f;for(var c=0;c<d;c++)a+=b.random(e);return a}},RNG.$=new RNG </script> <script>function FastBase64_Init(){for(var a=0;a<4096;a++)FastBase64_encLookup[a]=FastBase64_chars[a>>6]+FastBase64_chars[a&63]}function FastBase64_Encode(a){var b=a.length,c="",d=0;while(b>2)n=a[d]<<16|a[d+1]<<8|a[d+2],c+=FastBase64_encLookup[n>>12]+FastBase64_encLookup[n&4095],b-=3,d+=3;if(b>0){var e=(a[d]&252)>>2,f=(a[d]&3)<<4;b>1&&(f|=(a[++d]&240)>>4),c+=FastBase64_chars[e],c+=FastBase64_chars[f];if(b==2){var g=(a[d++]&15)<<2;g|=(a[d]&192)>>6,c+=FastBase64_chars[g]}b==1&&(c+="="),c+="="}return c}function u32ToArray(a){return[a&255,a>>8&255,a>>16&255,a>>24&255]}function u16ToArray(a){return[a&255,a>>8&255]}function MakeRiff(a,b,c){var d=[],e=[],f=[],g={chunkId:[82,73,70,70],chunkSize:0,format:[87,65,86,69],subChunk1Id:[102,109,116,32],subChunk1Size:16,audioFormat:1,numChannels:1,sampleRate:a,byteRate:0,blockAlign:0,bitsPerSample:b,subChunk2Id:[100,97,116,97],subChunk2Size:0};g.byteRate=g.sampleRate*g.numChannels*g.bitsPerSample>>3,g.blockAlign=g.numChannels*g.bitsPerSample>>3,g.subChunk2Size=c.length,g.chunkSize=36+g.subChunk2Size,e=g.chunkId.concat(u32ToArray(g.chunkSize),g.format,g.subChunk1Id,u32ToArray(g.subChunk1Size),u16ToArray(g.audioFormat),u16ToArray(g.numChannels),u32ToArray(g.sampleRate),u32ToArray(g.byteRate),u16ToArray(g.blockAlign),u16ToArray(g.bitsPerSample),g.subChunk2Id,u32ToArray(g.subChunk2Size),c),f="data:audio/wav;base64,"+FastBase64_Encode(e);var h={dat:d,wav:e,header:g,dataURI:f};return h}var FastBase64_chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",FastBase64_encLookup=[];FastBase64_Init(),typeof exports!="undefined"&&(exports.RIFFWAVE=RIFFWAVE) </script> <script>function Params(){var a={};return a.wave_type=SQUARE,a.p_env_attack=0,a.p_env_sustain=.3,a.p_env_punch=0,a.p_env_decay=.4,a.p_base_freq=.3,a.p_freq_limit=0,a.p_freq_ramp=0,a.p_freq_dramp=0,a.p_vib_strength=0,a.p_vib_speed=0,a.p_arp_mod=0,a.p_arp_speed=0,a.p_duty=0,a.p_duty_ramp=0,a.p_repeat_speed=0,a.p_pha_offset=0,a.p_pha_ramp=0,a.p_lpf_freq=1,a.p_lpf_ramp=0,a.p_lpf_resonance=0,a.p_hpf_freq=0,a.p_hpf_ramp=0,a.sound_vol=.5,a.sample_rate=44100,a.sample_size=8,a}function frnd(a){return seeded?rng.uniform()*a:Math.random()*a}function rnd(a){return seeded?Math.floor(rng.uniform()*(a+1)):Math.floor(Math.random()*(a+1))}function cacheSeed(a){if(a in sfxCache)return;var b=generateFromSeed(a);b.sound_vol=SOUND_VOL,b.sample_rate=SAMPLE_RATE,b.sample_size=SAMPLE_SIZE;var c=generate(b),d=new Audio;d.src=c.dataURI,sfxCache[a]=d,cachedSeeds.push(a);while(cachedSeeds.length>CACHE_MAX){var e=cachedSeeds[0];cachedSeeds=cachedSeeds.slice(1),delete sfxCache[e]}}function playSeed(a){if(unitTesting)return;cacheSeed(a);var b=sfxCache[a];b.cloneNode().play()}var SOUND_VOL=.25,SAMPLE_RATE=5512,SAMPLE_SIZE=8,SQUARE=0,SAWTOOTH=1,SINE=2,NOISE=3,TRIANGLE=4,BREAKER=5,SHAPES=["square","sawtooth","sine","noise","triangle","breaker"],masterVolume=1,rng,seeded=!1;pickupCoin=function(){var a=Params();a.wave_type=Math.floor(frnd(SHAPES.length)),a.wave_type===3&&(a.wave_type=0),a.p_base_freq=.4+frnd(.5),a.p_env_attack=0,a.p_env_sustain=frnd(.1),a.p_env_decay=.1+frnd(.4),a.p_env_punch=.3+frnd(.3);if(rnd(1)){a.p_arp_speed=.5+frnd(.2);var b=(frnd(7)|1)+1,c=b+(frnd(7)|1)+2;a.p_arp_mod=+b/+c}return a},laserShoot=function(){var a=Params();return a.wave_type=rnd(2),a.wave_type===SINE&&rnd(1)&&(a.wave_type=rnd(1)),a.wave_type=Math.floor(frnd(SHAPES.length)),a.wave_type===3&&(a.wave_type=SQUARE),a.p_base_freq=.5+frnd(.5),a.p_freq_limit=a.p_base_freq-.2-frnd(.6),a.p_freq_limit<.2&&(a.p_freq_limit=.2),a.p_freq_ramp=-0.15-frnd(.2),rnd(2)===0&&(a.p_base_freq=.3+frnd(.6),a.p_freq_limit=frnd(.1),a.p_freq_ramp=-0.35-frnd(.3)),rnd(1)?(a.p_duty=frnd(.5),a.p_duty_ramp=frnd(.2)):(a.p_duty=.4+frnd(.5),a.p_duty_ramp=-frnd(.7)),a.p_env_attack=0,a.p_env_sustain=.1+frnd(.2),a.p_env_decay=frnd(.4),rnd(1)&&(a.p_env_punch=frnd(.3)),rnd(2)===0&&(a.p_pha_offset=frnd(.2),a.p_pha_ramp=-frnd(.2)),rnd(1)&&(a.p_hpf_freq=frnd(.3)),a},explosion=function(){var a=Params();return rnd(1)?(a.p_base_freq=.1+frnd(.4),a.p_freq_ramp=-0.1+frnd(.4)):(a.p_base_freq=.2+frnd(.7),a.p_freq_ramp=-0.2-frnd(.2)),a.p_base_freq*=a.p_base_freq,rnd(4)===0&&(a.p_freq_ramp=0),rnd(2)===0&&(a.p_repeat_speed=.3+frnd(.5)),a.p_env_attack=0,a.p_env_sustain=.1+frnd(.3),a.p_env_decay=frnd(.5),rnd(1)===0&&(a.p_pha_offset=-0.3+frnd(.9),a.p_pha_ramp=-frnd(.3)),a.p_env_punch=.2+frnd(.6),rnd(1)&&(a.p_vib_strength=frnd(.7),a.p_vib_speed=frnd(.6)),rnd(2)===0&&(a.p_arp_speed=.6+frnd(.3),a.p_arp_mod=.8-frnd(1.6)),a},birdSound=function(){var a=Params();if(frnd(10)<1)return a.wave_type=Math.floor(frnd(SHAPES.length)),a.wave_type===3&&(a.wave_type=SQUARE),a.p_env_attack=.4304400932967592+frnd(.2)-.1,a.p_env_sustain=.15739346034252394+frnd(.2)-.1,a.p_env_punch=.004488201744871758+frnd(.2)-.1,a.p_env_decay=.07478075528212291+frnd(.2)-.1,a.p_base_freq=.9865265720147687+frnd(.2)-.1,a.p_freq_limit=0+frnd(.2)-.1,a.p_freq_ramp=-0.2995018224359539+frnd(.2)-.1,frnd(1)<.5&&(a.p_freq_ramp=.1+frnd(.15)),a.p_freq_dramp=.004598608156964473+frnd(.1)-.05,a.p_vib_strength=-0.2202799497929496+frnd(.2)-.1,a.p_vib_speed=.8084998703158364+frnd(.2)-.1,a.p_arp_mod=0,a.p_arp_speed=0,a.p_duty=-0.9031808754347107+frnd(.2)-.1,a.p_duty_ramp=-0.8128699999808343+frnd(.2)-.1,a.p_repeat_speed=.601486018931999+frnd(.2)-.1,a.p_pha_offset=-0.9424902314367765+frnd(.2)-.1,a.p_pha_ramp=-0.1055482222272056+frnd(.2)-.1,a.p_lpf_freq=.9989765717851521+frnd(.2)-.1,a.p_lpf_ramp=-0.25051720626043017+frnd(.2)-.1,a.p_lpf_resonance=.32777871505494693+frnd(.2)-.1,a.p_hpf_freq=.0023548750981756753+frnd(.2)-.1,a.p_hpf_ramp=-0.002375673204842568+frnd(.2)-.1,a;if(frnd(10)<1)return a.wave_type=Math.floor(frnd(SHAPES.length)),a.wave_type===3&&(a.wave_type=SQUARE),a.p_env_attack=.5277795946672003+frnd(.2)-.1,a.p_env_sustain=.18243733568468432+frnd(.2)-.1,a.p_env_punch=-0.020159754546840117+frnd(.2)-.1,a.p_env_decay=.1561353422051903+frnd(.2)-.1,a.p_base_freq=.9028855606533718+frnd(.2)-.1,a.p_freq_limit=-0.008842787837148716,a.p_freq_ramp=-0.1,a.p_freq_dramp=-0.012891241489551925,a.p_vib_strength=-0.17923136138403065+frnd(.2)-.1,a.p_vib_speed=.908263385610142+frnd(.2)-.1,a.p_arp_mod=.41690153355414894+frnd(.2)-.1,a.p_arp_speed=.0010766233195860704+frnd(.2)-.1,a.p_duty=-0.8735363011184684+frnd(.2)-.1,a.p_duty_ramp=-0.7397985366747507+frnd(.2)-.1,a.p_repeat_speed=.0591789344172107+frnd(.2)-.1,a.p_pha_offset=-0.9961184222777699+frnd(.2)-.1,a.p_pha_ramp=-0.08234769395850523+frnd(.2)-.1,a.p_lpf_freq=.9412475115697335+frnd(.2)-.1,a.p_lpf_ramp=-0.18261358925834958+frnd(.2)-.1,a.p_lpf_resonance=.24541438107389477+frnd(.2)-.1,a.p_hpf_freq=-0.01831940280978611+frnd(.2)-.1,a.p_hpf_ramp=-0.03857383633171346+frnd(.2)-.1,a;if(frnd(10)<1)return a.wave_type=Math.floor(frnd(SHAPES.length)),a.wave_type===3&&(a.wave_type=SQUARE),a.p_env_attack=.4304400932967592+frnd(.2)-.1,a.p_env_sustain=.15739346034252394+frnd(.2)-.1,a.p_env_punch=.004488201744871758+frnd(.2)-.1,a.p_env_decay=.07478075528212291+frnd(.2)-.1,a.p_base_freq=.9865265720147687+frnd(.2)-.1,a.p_freq_limit=0+frnd(.2)-.1,a.p_freq_ramp=-0.2995018224359539+frnd(.2)-.1,a.p_freq_dramp=.004598608156964473+frnd(.2)-.1,a.p_vib_strength=-0.2202799497929496+frnd(.2)-.1,a.p_vib_speed=.8084998703158364+frnd(.2)-.1,a.p_arp_mod=-0.46410459213693644+frnd(.2)-.1,a.p_arp_speed=-0.10955361249587248+frnd(.2)-.1,a.p_duty=-0.9031808754347107+frnd(.2)-.1,a.p_duty_ramp=-0.8128699999808343+frnd(.2)-.1,a.p_repeat_speed=.7014860189319991+frnd(.2)-.1,a.p_pha_offset=-0.9424902314367765+frnd(.2)-.1,a.p_pha_ramp=-0.1055482222272056+frnd(.2)-.1,a.p_lpf_freq=.9989765717851521+frnd(.2)-.1,a.p_lpf_ramp=-0.25051720626043017+frnd(.2)-.1,a.p_lpf_resonance=.32777871505494693+frnd(.2)-.1,a.p_hpf_freq=.0023548750981756753+frnd(.2)-.1,a.p_hpf_ramp=-0.002375673204842568+frnd(.2)-.1,a;if(frnd(5)>1)return a.wave_type=Math.floor(frnd(SHAPES.length)),a.wave_type===3&&(a.wave_type=SQUARE),rnd(1)?(a.p_arp_mod=.2697849293151393+frnd(.2)-.1,a.p_arp_speed=-0.3131172257760948+frnd(.2)-.1,a.p_base_freq=.8090588299313949+frnd(.2)-.1,a.p_duty=-0.6210022920964955+frnd(.2)-.1,a.p_duty_ramp=-0.00043441813553182567+frnd(.2)-.1,a.p_env_attack=.004321877246874195+frnd(.2)-.1,a.p_env_decay=.1+frnd(.2)-.1,a.p_env_punch=.061737781504416146+frnd(.2)-.1,a.p_env_sustain=.4987252564798832+frnd(.2)-.1,a.p_freq_dramp=.31700340314222614+frnd(.2)-.1,a.p_freq_limit=0+frnd(.2)-.1,a.p_freq_ramp=-0.163380391341416+frnd(.2)-.1,a.p_hpf_freq=.4709005021145149+frnd(.2)-.1,a.p_hpf_ramp=.6924667290539194+frnd(.2)-.1,a.p_lpf_freq=.8351398631384511+frnd(.2)-.1,a.p_lpf_ramp=.36616557192873134+frnd(.2)-.1,a.p_lpf_resonance=-0.08685777111664439+frnd(.2)-.1,a.p_pha_offset=-0.036084571580025544+frnd(.2)-.1,a.p_pha_ramp=-0.014806445085568108+frnd(.2)-.1,a.p_repeat_speed=-0.8094368475518489+frnd(.2)-.1,a.p_vib_speed=.4496665457171294+frnd(.2)-.1,a.p_vib_strength=.23413762515532424+frnd(.2)-.1):(a.p_arp_mod=-0.35697118026766184+frnd(.2)-.1,a.p_arp_speed=.3581140690559588+frnd(.2)-.1,a.p_base_freq=1.3260897696157528+frnd(.2)-.1,a.p_duty=-0.30984900436710694+frnd(.2)-.1,a.p_duty_ramp=-0.0014374759133411626+frnd(.2)-.1,a.p_env_attack=.3160357835682254+frnd(.2)-.1,a.p_env_decay=.1+frnd(.2)-.1,a.p_env_punch=.24323114016870148+frnd(.2)-.1,a.p_env_sustain=.4+frnd(.2)-.1,a.p_freq_dramp=.2866475886237244+frnd(.2)-.1,a.p_freq_limit=0+frnd(.2)-.1,a.p_freq_ramp=-0.10956352368742976+frnd(.2)-.1,a.p_hpf_freq=.20772718017889846+frnd(.2)-.1,a.p_hpf_ramp=.1564090637378835+frnd(.2)-.1,a.p_lpf_freq=.6021372770637031+frnd(.2)-.1,a.p_lpf_ramp=.24016227139979027+frnd(.2)-.1,a.p_lpf_resonance=-0.08787383821160144+frnd(.2)-.1,a.p_pha_offset=-0.381597686151701+frnd(.2)-.1,a.p_pha_ramp=-0.0002481687661373495+frnd(.2)-.1,a.p_repeat_speed=.07812112809425686+frnd(.2)-.1,a.p_vib_speed=-0.13648848579133943+frnd(.2)-.1,a.p_vib_strength=.0018874158972302657+frnd(.2)-.1),a;a.wave_type=Math.floor(frnd(SHAPES.length));if(a.wave_type===1||a.wave_type===3)a.wave_type=2;return a.p_base_freq=.85+frnd(.15),a.p_freq_ramp=.3+frnd(.15),a.p_env_attack=0+frnd(.09),a.p_env_sustain=.2+frnd(.3),a.p_env_decay=0+frnd(.1),a.p_duty=frnd(2)-1,a.p_duty_ramp=Math.pow(frnd(2)-1,3),a.p_repeat_speed=.5+frnd(.1),a.p_pha_offset=-0.3+frnd(.9),a.p_pha_ramp=-frnd(.3),a.p_arp_speed=.4+frnd(.6),a.p_arp_mod=.8+frnd(.1),a.p_lpf_resonance=frnd(2)-1,a.p_lpf_freq=1-Math.pow(frnd(1),3),a.p_lpf_ramp=Math.pow(frnd(2)-1,3),a.p_lpf_freq<.1&&a.p_lpf_ramp<-0.05&&(a.p_lpf_ramp=-a.p_lpf_ramp),a.p_hpf_freq=Math.pow(frnd(1),5),a.p_hpf_ramp=Math.pow(frnd(2)-1,5),a},pushSound=function(){var a=Params();return a.wave_type=Math.floor(frnd(SHAPES.length)),a.wave_type===2&&a.wave_type++,a.wave_type===0&&(a.wave_type=NOISE),a.p_base_freq=.1+frnd(.4),a.p_freq_ramp=.05+frnd(.2),a.p_env_attack=.01+frnd(.09),a.p_env_sustain=.01+frnd(.09),a.p_env_decay=.01+frnd(.09),a.p_repeat_speed=.3+frnd(.5),a.p_pha_offset=-0.3+frnd(.9),a.p_pha_ramp=-frnd(.3),a.p_arp_speed=.6+frnd(.3),a.p_arp_mod=.8-frnd(1.6),a},powerUp=function(){var a=Params();return rnd(1)?a.wave_type=SAWTOOTH:a.p_duty=frnd(.6),a.wave_type=Math.floor(frnd(SHAPES.length)),a.wave_type===3&&(a.wave_type=SQUARE),rnd(1)?(a.p_base_freq=.2+frnd(.3),a.p_freq_ramp=.1+frnd(.4),a.p_repeat_speed=.4+frnd(.4)):(a.p_base_freq=.2+frnd(.3),a.p_freq_ramp=.05+frnd(.2),rnd(1)&&(a.p_vib_strength=frnd(.7),a.p_vib_speed=frnd(.6))),a.p_env_attack=0,a.p_env_sustain=frnd(.4),a.p_env_decay=.1+frnd(.4),a},hitHurt=function(){return result=Params(),result.wave_type=rnd(2),result.wave_type===SINE&&(result.wave_type=NOISE),result.wave_type===SQUARE&&(result.p_duty=frnd(.6)),result.wave_type=Math.floor(frnd(SHAPES.length)),result.p_base_freq=.2+frnd(.6),result.p_freq_ramp=-0.3-frnd(.4),result.p_env_attack=0,result.p_env_sustain=frnd(.1),result.p_env_decay=.1+frnd(.2),rnd(1)&&(result.p_hpf_freq=frnd(.3)),result},jump=function(){return result=Params(),result.wave_type=SQUARE,result.wave_type=Math.floor(frnd(SHAPES.length)),result.wave_type===3&&(result.wave_type=SQUARE),result.p_duty=frnd(.6),result.p_base_freq=.3+frnd(.3),result.p_freq_ramp=.1+frnd(.2),result.p_env_attack=0,result.p_env_sustain=.1+frnd(.3),result.p_env_decay=.1+frnd(.2),rnd(1)&&(result.p_hpf_freq=frnd(.3)),rnd(1)&&(result.p_lpf_freq=1-frnd(.6)),result},blipSelect=function(){return result=Params(),result.wave_type=rnd(1),result.wave_type=Math.floor(frnd(SHAPES.length)),result.wave_type===3&&(result.wave_type=rnd(1)),result.wave_type===SQUARE&&(result.p_duty=frnd(.6)),result.p_base_freq=.2+frnd(.4),result.p_env_attack=0,result.p_env_sustain=.1+frnd(.1),result.p_env_decay=frnd(.2),result.p_hpf_freq=.1,result},random=function(){return result=Params(),result.wave_type=Math.floor(frnd(SHAPES.length)),result.p_base_freq=Math.pow(frnd(2)-1,2),rnd(1)&&(result.p_base_freq=Math.pow(frnd(2)-1,3)+.5),result.p_freq_limit=0,result.p_freq_ramp=Math.pow(frnd(2)-1,5),result.p_base_freq>.7&&result.p_freq_ramp>.2&&(result.p_freq_ramp=-result.p_freq_ramp),result.p_base_freq<.2&&result.p_freq_ramp<-0.05&&(result.p_freq_ramp=-result.p_freq_ramp),result.p_freq_dramp=Math.pow(frnd(2)-1,3),result.p_duty=frnd(2)-1,result.p_duty_ramp=Math.pow(frnd(2)-1,3),result.p_vib_strength=Math.pow(frnd(2)-1,3),result.p_vib_speed=frnd(2)-1,result.p_env_attack=Math.pow(frnd(2)-1,3),result.p_env_sustain=Math.pow(frnd(2)-1,2),result.p_env_decay=frnd(2)-1,result.p_env_punch=Math.pow(frnd(.8),2),result.p_env_attack+result.p_env_sustain+result.p_env_decay<.2&&(result.p_env_sustain+=.2+frnd(.3),result.p_env_decay+=.2+frnd(.3)),result.p_lpf_resonance=frnd(2)-1,result.p_lpf_freq=1-Math.pow(frnd(1),3),result.p_lpf_ramp=Math.pow(frnd(2)-1,3),result.p_lpf_freq<.1&&result.p_lpf_ramp<-0.05&&(result.p_lpf_ramp=-result.p_lpf_ramp),result.p_hpf_freq=Math.pow(frnd(1),5),result.p_hpf_ramp=Math.pow(frnd(2)-1,5),result.p_pha_offset=Math.pow(frnd(2)-1,3),result.p_pha_ramp=Math.pow(frnd(2)-1,3),result.p_repeat_speed=frnd(2)-1,result.p_arp_speed=frnd(2)-1,result.p_arp_mod=frnd(2)-1,result};var generators=[pickupCoin,laserShoot,explosion,powerUp,hitHurt,jump,blipSelect,pushSound,random,birdSound],generatorNames=["pickupCoin","laserShoot","explosion","powerUp","hitHurt","jump","blipSelect","pushSound","random","birdSound"];generateFromSeed=function(a){rng=new RNG(a/100|0);var b=a%100,c=generators[b%generators.length];seeded=!0;var d=c();return d.seed=a,seeded=!1,d};var generate=function(a){function b(){c=0,d=100/(a.p_base_freq*a.p_base_freq+.001),e=Math.floor(d),f=100/(a.p_freq_limit*a.p_freq_limit+.001),g=1-Math.pow(a.p_freq_ramp,3)*.01,h=-Math.pow(a.p_freq_dramp,3)*1e-6,i=.5-a.p_duty*.5,j=-a.p_duty_ramp*5e-5,a.p_arp_mod>=0?k=1-Math.pow(a.p_arp_mod,2)*.9:k=1+Math.pow(a.p_arp_mod,2)*10,l=0,m=Math.floor(Math.pow(1-a.p_arp_speed,2)*2e4+32),a.p_arp_speed==1&&(m=0)}var c,d,e,f,g,h,i,j,k,l,m;b();var n=0,o=0,p=Math.pow(a.p_lpf_freq,3)*.1,q=1+a.p_lpf_ramp*1e-4,r=5/(1+Math.pow(a.p_lpf_resonance,2)*20)*(.01+p);r>.8&&(r=.8);var s=0,t=Math.pow(a.p_hpf_freq,2)*.1,u=1+a.p_hpf_ramp*3e-4,v=0,w=Math.pow(a.p_vib_speed,2)*.01,x=a.p_vib_strength*.5,y=0,z=0,A=0,B=[Math.floor(a.p_env_attack*a.p_env_attack*1e5),Math.floor(a.p_env_sustain*a.p_env_sustain*1e5),Math.floor(a.p_env_decay*a.p_env_decay*1e5)],C=0,D=Math.pow(a.p_pha_offset,2)*1020;a.p_pha_offset<0&&(D=-D);var E=Math.pow(a.p_pha_ramp,2)*1;a.p_pha_ramp<0&&(E=-E);var F=Math.abs(Math.floor(D)),G=0,H=[];for(var I=0;I<1024;++I)H[I]=0;var J=[];for(var I=0;I<32;++I)J[I]=Math.random()*2-1;var K=Math.floor(Math.pow(1-a.p_repeat_speed,2)*2e4+32);a.p_repeat_speed==0&&(K=0);var L=2*a.sound_vol,L=Math.exp(a.sound_vol)-1,M=0,N=[],O=0,P=0,Q=Math.floor(44100/a.sample_rate);for(var R=0;;++R){K!=0&&++c>=K&&b(),m!=0&&R>=m&&(m=0,d*=k),g+=h,d*=g;if(d>f){d=f;if(a.p_freq_limit>0)break}var S=d;x>0&&(v+=w,S=d*(1+Math.sin(v)*x)),e=Math.floor(S),e<8&&(e=8),i+=j,i<0&&(i=0),i>.5&&(i=.5),A++;if(A>B[z]){A=0,z++;if(z===3)break}z===0?y=A/B[0]:z===1?y=1+Math.pow(1-A/B[1],1)*2*a.p_env_punch:y=1-A/B[2],D+=E,F=Math.abs(Math.floor(D)),F>1023&&(F=1023),u!=0&&(t*=u,t<1e-5&&(t=1e-5),t>.1&&(t=.1));var T=0;for(var U=0;U<8;++U){var V=0;C++;if(C>=e){C%=e;if(a.wave_type===NOISE)for(var I=0;I<32;++I)J[I]=Math.random()*2-1}var W=C/e;if(a.wave_type===SQUARE)W<i?V=.5:V=-0.5;else if(a.wave_type===SAWTOOTH)V=1-W*2;else if(a.wave_type===SINE)V=Math.sin(W*2*Math.PI);else if(a.wave_type===NOISE)V=J[Math.floor(C*32/e)];else if(a.wave_type===TRIANGLE)V=Math.abs(1-W*2)-1;else if(a.wave_type===BREAKER)V=Math.abs(1-W*W*2)-1;else throw new Exception("bad wave type! "+a.wave_type);var X=n;p*=q,p<0&&(p=0),p>.1&&(p=.1),a.p_lpf_freq!=1?(o+=(V-n)*p,o-=o*r):(n=V,o=0),n+=o,s+=n-X,s-=s*t,V=s,H[G&1023]=V,V+=H[G-F+1024&1023],G=G+1&1023,T+=V*y}O+=T;if(++P>=Q)P=0,T=O/Q,O=0;else continue;T=T/8*masterVolume,T*=L,a.sample_size===8?(T=Math.floor((T+1)*128),T>255?(T=255,++M):T<0&&(T=0,++M),N.push(T)):(T=Math.floor(T*32768),T>=32768?(T=32767,++M):T<-32768&&(T=-32768,++M),N.push(T&255),N.push(T>>8&255))}var Y=MakeRiff(a.sample_rate,a.sample_size,N);return Y.clipping=M,Y};if(typeof exports!="undefined"){var RIFFWAVE=require("./riffwave").RIFFWAVE;exports.Params=Params,exports.generate=generate}var sfxCache={},cachedSeeds=[],CACHE_MAX=50 </script> <script>colorPalettes={mastersystem:{black:"#000000",white:"#FFFFFF",grey:"#555555",darkgrey:"#555500",lightgrey:"#AAAAAA",gray:"#555555",darkgray:"#555500",lightgray:"#AAAAAA",red:"#FF0000",darkred:"#AA0000",lightred:"#FF5555",brown:"#AA5500",darkbrown:"#550000",lightbrown:"#FFAA00",orange:"#FF5500",yellow:"#FFFF55",green:"#55AA00",darkgreen:"#005500",lightgreen:"#AAFF00",blue:"#5555AA",lightblue:"#AAFFFF",darkblue:"#000055",purple:"#550055",pink:"#FFAAFF"},gameboycolour:{black:"#000000",white:"#FFFFFF",grey:"#7F7F7C",darkgrey:"#3E3E44",lightgrey:"#BAA7A7",gray:"#7F7F7C",darkgray:"#3E3E44",lightgray:"#BAA7A7",red:"#A7120C",darkred:"#880606",lightred:"#BA381F",brown:"#57381F",darkbrown:"#3E2519",lightbrown:"#8E634B",orange:"#BA4B32",yellow:"#C0BA6F",green:"#517525",darkgreen:"#385D12",lightgreen:"#6F8E44",blue:"#5D6FA7",lightblue:"#8EA7A7",darkblue:"#4B575D",purple:"#3E3E44",pink:"#BA381F"},amiga:{black:"#000000",white:"#FFFFFF",grey:"#BBBBBB",darkgrey:"#333333",lightgrey:"#FFEEDD",gray:"#BBBBBB",darkgray:"#333333",lightgray:"#FFEEDD",red:"#DD1111",darkred:"#990000",lightred:"#FF4422",brown:"#663311",darkbrown:"#331100",lightbrown:"#AA6644",orange:"#FF6644",yellow:"#FFDD66",green:"#448811",darkgreen:"#335500",lightgreen:"#88BB77",blue:"#8899DD",lightblue:"#BBDDEE",darkblue:"#666688",purple:"#665555",pink:"#997788"},arnecolors:{black:"#000000",white:"#FFFFFF",grey:"#9d9d9d",darkgrey:"#697175",lightgrey:"#cccccc",gray:"#9d9d9d",darkgray:"#697175",lightgray:"#cccccc",red:"#be2633",darkred:"#732930",lightred:"#e06f8b",brown:"#a46422",darkbrown:"#493c2b",lightbrown:"#eeb62f",orange:"#eb8931",yellow:"#f7e26b",green:"#44891a",darkgreen:"#2f484e",lightgreen:"#a3ce27",blue:"#1d57f7",lightblue:"#B2DCEF",darkblue:"#1B2632",purple:"#342a97",pink:"#de65e2"},famicom:{black:"#000000",white:"#ffffff",grey:"#7c7c7c",darkgrey:"#080808",lightgrey:"#bcbcbc",gray:"#7c7c7c",darkgray:"#080808",lightgray:"#bcbcbc",red:"#f83800",darkred:"#881400",lightred:"#f87858",brown:"#AC7C00",darkbrown:"#503000",lightbrown:"#FCE0A8",orange:"#FCA044",yellow:"#F8B800",green:"#00B800",darkgreen:"#005800",lightgreen:"#B8F8B8",blue:"#0058F8",lightblue:"#3CBCFC",darkblue:"#0000BC",purple:"#6644FC",pink:"#F878F8"},atari:{black:"#000000",white:"#FFFFFF",grey:"#909090",darkgrey:"#404040",lightgrey:"#b0b0b0",gray:"#909090",darkgray:"#404040",lightgray:"#b0b0b0",red:"#A03C50",darkred:"#700014",lightred:"#DC849C",brown:"#805020",darkbrown:"#703400",lightbrown:"#CB9870",orange:"#CCAC70",yellow:"#ECD09C",green:"#58B06C",darkgreen:"#006414",lightgreen:"#70C484",blue:"#1C3C88",lightblue:"#6888C8",darkblue:"#000088",purple:"#3C0080",pink:"#B484DC"},pastel:{black:"#000000",white:"#FFFFFF",grey:"#3e3e3e",darkgrey:"#313131",lightgrey:"#9cbcbc",gray:"#3e3e3e",darkgray:"#313131",lightgray:"#9cbcbc",red:"#f56ca2",darkred:"#a63577",lightred:"#ffa9cf",brown:"#b58c53",darkbrown:"#787562",lightbrown:"#B58C53",orange:"#EB792D",yellow:"#FFe15F",green:"#00FF4F",darkgreen:"#2b732c",lightgreen:"#97c04f",blue:"#0f88d3",lightblue:"#00fffe",darkblue:"#293a7b",purple:"#ff6554",pink:"#eb792d"},ega:{black:"#000000",white:"#ffffff",grey:"#555555",darkgrey:"#555555",lightgrey:"#aaaaaa",gray:"#555555",darkgray:"#555555",lightgray:"#aaaaaa",red:"#ff5555",darkred:"#aa0000",lightred:"#ff55ff",brown:"#aa5500",darkbrown:"#aa5500",lightbrown:"#ffff55",orange:"#ff5555",yellow:"#ffff55",green:"#00aa00",darkgreen:"#00aaaa",lightgreen:"#55ff55",blue:"#5555ff",lightblue:"#55ffff",darkblue:"#0000aa",purple:"#aa00aa",pink:"#ff55ff"},proteus_mellow:{black:"#3d2d2e",white:"#ddf1fc",grey:"#9fb2d4",darkgrey:"#7b8272",lightgrey:"#a4bfda",gray:"#9fb2d4",darkgray:"#7b8272",lightgray:"#a4bfda",red:"#9d5443",darkred:"#8c5b4a",lightred:"#94614c",brown:"#89a78d",darkbrown:"#829e88",lightbrown:"#aaae97",orange:"#d1ba86",yellow:"#d6cda2",green:"#75ac8d",darkgreen:"#8fa67f",lightgreen:"#8eb682",blue:"#88a3ce",lightblue:"#a5adb0",darkblue:"#5c6b8c",purple:"#d39fac",pink:"#c8ac9e"},proteus_night:{black:"#010912",white:"#fdeeec",grey:"#051d40",darkgrey:"#091842",lightgrey:"#062151",gray:"#051d40",darkgray:"#091842",lightgray:"#062151",red:"#ad4576",darkred:"#934765",lightred:"#ab6290",brown:"#61646b",darkbrown:"#3d2d2d",lightbrown:"#8393a0",orange:"#0a2227",yellow:"#0a2541",green:"#75ac8d",darkgreen:"#0a2434",lightgreen:"#061f2e",blue:"#0b2c79",lightblue:"#809ccb",darkblue:"#08153b",purple:"#666a87",pink:"#754b4d"},proteus_rich:{black:"#6f686f",white:"#d1b1e2",grey:"#b9aac1",darkgrey:"#8e8b84",lightgrey:"#c7b5cd",gray:"#b9aac1",darkgray:"#8e8b84",lightgray:"#c7b5cd",red:"#a11f4f",darkred:"#934765",lightred:"#c998ad",brown:"#89867d",darkbrown:"#797f75",lightbrown:"#ab9997",orange:"#ce8c5c",yellow:"#f0d959",green:"#75bc54",darkgreen:"#599d79",lightgreen:"#90cf5c",blue:"#8fd0ec",lightblue:"#bcdce7",darkblue:"#0b2c70",purple:"#9b377f",pink:"#cd88e5"},amstrad:{black:"#000000",white:"#ffffff",grey:"#7f7f7f",darkgrey:"#636363",lightgrey:"#afafaf",gray:"#7f7f7f",darkgray:"#636363",lightgray:"#afafaf",red:"#ff0000",darkred:"#7f0000",lightred:"#ff7f7f",brown:"#ff7f00",darkbrown:"#7f7f00",lightbrown:"#ffff00",orange:"#ff007f",yellow:"#ffff7f",green:"#01ff00",darkgreen:"#007f00",lightgreen:"#7fff7f",blue:"#0000ff",lightblue:"#7f7fff",darkblue:"#00007f",purple:"#7f007f",pink:"#ff7fff"},c64:{black:"#000000",white:"#ffffff",grey:"#6C6C6C",darkgrey:"#444444",lightgrey:"#959595",gray:"#6C6C6C",darkgray:"#444444",lightgray:"#959595",red:"#68372B",darkred:"#3f1e17",lightred:"#9A6759",brown:"#433900",darkbrown:"#221c02",lightbrown:"#6d5c0d",orange:"#6F4F25",yellow:"#B8C76F",green:"#588D43",darkgreen:"#345129",lightgreen:"#9AD284",blue:"#6C5EB5",lightblue:"#70A4B2",darkblue:"#352879",purple:"#6F3D86",pink:"#b044ac"},whitingjp:{black:"#202527",white:"#eff8fd",grey:"#7b7680",darkgrey:"#3c3b44",lightgrey:"#bed0d7",gray:"#7b7680",darkgray:"#3c3b44",lightgray:"#bed0d7",red:"#bd194b",darkred:"#6b1334",lightred:"#ef2358",brown:"#b52e1c",darkbrown:"#681c12",lightbrown:"#e87b45",orange:"#ff8c10",yellow:"#fbd524",green:"#36bc3c",darkgreen:"#317610",lightgreen:"#8ce062",blue:"#3f62c6",lightblue:"#57bbe0",darkblue:"#2c2fa0",purple:"#7037d9",pink:"#ec2b8f"}};var reg_color_names=/(black|white|darkgray|lightgray|gray|grey|darkgrey|lightgrey|red|darkred|lightred|brown|darkbrown|lightbrown|orange|yellow|green|darkgreen|lightgreen|blue|lightblue|darkblue|purple|pink)\s*/,reg_color=/(black|white|gray|darkgray|lightgray|grey|darkgrey|lightgrey|red|darkred|lightred|brown|darkbrown|lightbrown|orange|yellow|green|darkgreen|lightgreen|blue|lightblue|darkblue|purple|pink|#(?:[0-9a-f]{3}){1,2})\s*/ </script> <script>function setPixel(a,b,c,d,e,f,g){index=(b+c*a.width)*4,a.data[index+0]=d,a.data[index+1]=e,a.data[index+2]=f,a.data[index+3]=g}function createSprite(a,b,c){b.clearRect(0,0,cellwidth,cellheight);var d=font[c],e=5,f=5,g=~~(cellwidth/6),h=~~(cellheight/6),i=h;"scanline"in state.metadata&&(i=Math.ceil(h/2)),b.fillStyle=state.fgcolor;for(var j=0;j<e;j++)for(var k=0;k<f;k++){var l=~~(j*g),m=~~(k*h);d[j][k]==1&&b.fillRect(m,l,g,i)}var n=a.toDataURL(),o=document.createElement("img");return o.onload=redraw,o.src=n,o}function regenText(a,b){textImages={};for(var c in font)font.hasOwnProperty(c)&&(textImages[c]=createSprite(a,b,c))}function regenSpriteImages(){var a=document.createElement("canvas");a.width=cellwidth,a.height=cellheight;var b=a.getContext("2d"),c=5,d=5,e=~~(cellwidth/c),f=~~(cellheight/d);regenText(a,b);if(state.levels.length===0)return;spriteimages=[];for(var g=0;g<sprites.length;g++){if(sprites[g]==undefined)continue;b.clearRect(0,0,cellwidth,cellheight);var h=sprites[g].dat,i=f;"scanline"in state.metadata&&(i=Math.ceil(f/2));var j=sprites[g].colors;for(var k=0;k<c;k++)for(var l=0;l<d;l++){var m=h[k][l];if(m>=0){var n=k*e|0,o=l*f|0;b.fillStyle=j[m],b.fillRect(o,n,e,i)}}var p=a.toDataURL(),q=document.createElement("img");q.onload=redraw,q.src=p,spriteimages[g]=q}canOpenEditor&&generateGlyphImages(a,b)}function generateGlyphImages(a,b){glyphImagesCorrespondance=[],glyphImages=[];for(var c in state.glyphDict)if(c.length==1&&state.glyphDict.hasOwnProperty(c)){var d=state.glyphDict[c];glyphImagesCorrespondance.push(c),b.clearRect(0,0,cellwidth,cellheight);for(var e=0;e<d.length;e++){var f=d[e];if(f===-1)continue;var g=spriteimages[f];b.drawImage(g,0,0)}var h=a.toDataURL(),i=document.createElement("img");i.onload=redraw,i.src=h,glyphImages.push(i)}b.fillStyle="#FFFFFF",b.clearRect(0,0,cellwidth,cellheight),b.fillRect(0,0,cellwidth,1),b.fillRect(0,0,1,cellheight),b.fillRect(0,cellheight-1,cellwidth,1),b.fillRect(cellwidth-1,0,1,cellheight);var h=a.toDataURL(),i=document.createElement("img");i.onload=redraw,i.src=h,glyphHighlight=i,glyphPrintButton=createSprite(a,b,"s"),b.fillStyle="#FFFFFF",b.clearRect(0,0,cellwidth,cellheight);var j=cellwidth/2-1|0,k=cellwidth-j-1-j,l=cellheight/2-1|0,m=cellheight-l-1-j;b.fillRect(j,0,k,cellheight),b.fillRect(0,l,cellwidth,m);var h=a.toDataURL(),i=document.createElement("img");i.onload=redraw,i.src=h,glyphHighlightResize=i,b.fillStyle="yellow",b.clearRect(0,0,cellwidth,cellheight),b.fillRect(0,0,cellwidth,2),b.fillRect(0,0,2,cellheight),b.fillRect(0,cellheight-2,cellwidth,2),b.fillRect(cellwidth-2,0,2,cellheight);var h=a.toDataURL(),i=document.createElement("img");i.onload=redraw,i.src=h,glyphMouseOver=i}function glyphCount(){var a=0;for(var b in state.glyphDict)b.length==1&&state.glyphDict.hasOwnProperty(b)&&a++;return a}function redraw(){if(textMode){for(var a in textImages)if(textImages.hasOwnProperty(a)){var b=textImages[a];if(!b.complete)return;if(b.width===0||b.height===0)return}ctx.fillStyle=state.bgcolor,ctx.fillRect(0,0,canvas.width,canvas.height);for(var c=0;c<titleWidth;c++)for(var d=0;d<titleHeight;d++){var e=titleImage[d].charAt(c);if(e in textImages){var f=textImages[e];ctx.drawImage(f,xoffset+c*cellwidth,yoffset+d*cellheight)}}return}spriteimages===undefined&®enSpriteImages();for(var c=0;c<spriteimages.length;c++){var b=spriteimages[c];if(b==undefined)continue;if(!b.complete)return}ctx.fillStyle=state.bgcolor,ctx.fillRect(0,0,canvas.width,canvas.height);var g=0,h=screenwidth,i=0,j=screenheight;if(levelEditorOpened){var k=glyphCount();editorRowCount=Math.ceil(k/(screenwidth-1)),h-=2,j-=2+editorRowCount}else if(flickscreen){var l=getPlayerPositions();if(l.length>0){var m=l[0],n=m/level.height|0,o=m%level.height|0,p=n/screenwidth|0,q=o/screenheight|0;g=p*screenwidth,i=q*screenheight,h=Math.min(g+screenwidth,level.width),j=Math.min(i+screenheight,level.height),oldflickscreendat=[g,i,h,j]}else oldflickscreendat.length>0&&(g=oldflickscreendat[0],i=oldflickscreendat[1],h=oldflickscreendat[2],j=oldflickscreendat[3])}else if(zoomscreen){var l=getPlayerPositions();if(l.length>0){var m=l[0],n=m/level.height|0,o=m%level.height|0;g=Math.max(n-(screenwidth/2|0),0),i=Math.max(o-(screenheight/2|0),0),h=Math.min(g+screenwidth,level.width),j=Math.min(i+screenheight,level.height),oldflickscreendat=[g,i,h,j]}else oldflickscreendat.length>0&&(g=oldflickscreendat[0],i=oldflickscreendat[1],h=oldflickscreendat[2],j=oldflickscreendat[3])}for(var c=g;c<h;c++)for(var d=i;d<j;d++){var r=d+c*level.height,s=level.dat[r];for(var t=0;t<state.objectCount;t++){var u=1<<t;if((s&u)!=0){var f=spriteimages[t];ctx.drawImage(f,xoffset+(c-g)*cellwidth,yoffset+(d-i)*cellheight)}}}levelEditorOpened&&drawEditorIcons()}function drawEditorIcons(){var a=glyphImages.length,b=0,c=glyphImages.length,d=c-b;ctx.drawImage(glyphPrintButton,xoffset-cellwidth,yoffset-cellheight*(1+editorRowCount)),mouseCoordY===-1-editorRowCount&&mouseCoordX===-1&&ctx.drawImage(glyphMouseOver,xoffset-cellwidth,yoffset-cellheight*(1+editorRowCount));var e=editorRowCount-(-mouseCoordY-2)-1,f=mouseCoordX+(screenwidth-1)*e;for(var g=0;g<d;g++){var h=b+g,i=glyphImages[h],j=g%(screenwidth-1),e=g/(screenwidth-1)|0;ctx.drawImage(i,xoffset+j*cellwidth,yoffset+e*cellheight-cellheight*(1+editorRowCount)),mouseCoordX>=0&&mouseCoordX<screenwidth-1&&f===g&&ctx.drawImage(glyphMouseOver,xoffset+j*cellwidth,yoffset+e*cellheight-cellheight*(1+editorRowCount)),g===glyphSelectedIndex&&ctx.drawImage(glyphHighlight,xoffset+j*cellwidth,yoffset+e*cellheight-cellheight*(1+editorRowCount))}mouseCoordX>=-1&&mouseCoordY>=-1&&mouseCoordX<screenwidth-1&&mouseCoordY<screenheight-1-editorRowCount&&(mouseCoordX==-1||mouseCoordY==-1||mouseCoordX==screenwidth-2||mouseCoordY===screenheight-2-editorRowCount?ctx.drawImage(glyphHighlightResize,xoffset+mouseCoordX*cellwidth,yoffset+mouseCoordY*cellheight):ctx.drawImage(glyphHighlight,xoffset+mouseCoordX*cellwidth,yoffset+mouseCoordY*cellheight))}function canvasResize(){canvas.style.width=canvas.parentNode.clientWidth,canvas.style.height=canvas.parentNode.clientHeight,canvas.width=canvas.parentNode.clientWidth,canvas.height=canvas.parentNode.clientHeight,screenwidth=level.width,screenheight=level.height;if(state!==undefined){flickscreen=state.metadata.flickscreen!==undefined,zoomscreen=state.metadata.zoomscreen!==undefined;if(levelEditorOpened){screenwidth+=2;var a=glyphCount();editorRowCount=Math.ceil(a/(screenwidth-1)),screenheight+=2+editorRowCount}else flickscreen?(screenwidth=state.metadata.flickscreen[0],screenheight=state.metadata.flickscreen[1]):zoomscreen&&(screenwidth=state.metadata.zoomscreen[0],screenheight=state.metadata.zoomscreen[1])}textMode&&(levelEditorOpened=!1,screenwidth=titleWidth,screenheight=titleHeight),cellwidth=canvas.width/screenwidth,cellheight=canvas.height/screenheight;var b=5,c=5;textMode&&(b=6,c=6),cellwidth=b*~~(cellwidth/b),cellheight=c*~~(cellheight/c),xoffset=0,yoffset=0,cellwidth>cellheight?(cellwidth=cellheight,xoffset=(canvas.width-cellwidth*screenwidth)/2,yoffset=(canvas.height-cellheight*screenheight)/2):(cellheight=cellwidth,yoffset=(canvas.height-cellheight*screenheight)/2,xoffset=(canvas.width-cellwidth*screenwidth)/2),magnification=cellwidth/b*5|0,levelEditorOpened&&(xoffset+=cellwidth,yoffset+=cellheight*(1+editorRowCount)),cellwidth|=0,cellheight|=0,xoffset|=0,yoffset|=0;if(oldcellwidth!=cellwidth||oldcellheight!=cellheight||oldtextmode!=textMode||forceRegenImages)forceRegenImages=!1,regenSpriteImages();oldcellheight=cellheight,oldcellwidth=cellwidth,oldtextmode=textMode,redraw()}var spriteimages,glyphImagesCorrespondance,glyphImages,glyphHighlight,glyphHighlightResize,glyphPrintButton,glyphMouseOver,glyphSelectedIndex=0,editorRowCount=1,canvas,ctx,x,y,cellwidth,cellheight,magnification,xoffset,yoffset;window.console.log("init"),window.addEventListener("resize",canvasResize,!1),canvas=document.getElementById("gameCanvas"),ctx=canvas.getContext("2d"),x=0,y=0;var lastDownTarget,oldcellwidth=0,oldcellheight=0,oldtextmode=-1,forceRegenImages=!1 </script> <script>function recalcLevelBounds(){level.movementMask=level.dat.concat([]),level.rigidMovementAppliedMask=level.dat.concat([]),level.rigidGroupIndexMask=level.dat.concat([]),level.commandQueue=[];for(var a=0;a<level.movementMask.length;a++)level.movementMask[a]=0,level.rigidMovementAppliedMask[a]=0,level.rigidGroupIndexMask[a]=0}function addLeftColumn(){var a=1<<state.backgroundid;for(var b=0;b<level.height;b++)level.dat.splice(b,0,a);level.width++,recalcLevelBounds(),columnAdded=!0}function addRightColumn(){var a=1<<state.backgroundid;for(var b=0;b<level.height;b++)level.dat.push(a);level.width++,recalcLevelBounds(),columnAdded=!0}function addTopRow(){var a=1<<state.backgroundid;for(var b=level.width-1;b>=0;b--)level.dat.splice(b*level.height,0,a);level.height++,recalcLevelBounds(),columnAdded=!0}function addBottomRow(){var a=1<<state.backgroundid;for(var b=level.width-1;b>=0;b--)level.dat.splice(level.height+b*level.height,0,a);level.height++,recalcLevelBounds(),columnAdded=!0}function removeLeftColumn(){if(level.width<=1)return;var a=1<<state.backgroundid;for(var b=0;b<level.height;b++)level.dat.splice(0,1);level.width--,recalcLevelBounds(),columnAdded=!0}function removeRightColumn(){if(level.width<=1)return;var a=1<<state.backgroundid;for(var b=0;b<level.height;b++)level.dat.splice(level.dat.length-1,1);level.width--,recalcLevelBounds(),columnAdded=!0}function removeTopRow(){if(level.height<=1)return;var a=1<<state.backgroundid;for(var b=level.width-1;b>=0;b--)level.dat.splice(b*level.height,1);level.height--,recalcLevelBounds(),columnAdded=!0}function removeBottomRow(){if(level.height<=1)return;var a=1<<state.backgroundid;for(var b=level.width-1;b>=0;b--)level.dat.splice(level.height-1+b*level.height,1);level.height--,recalcLevelBounds(),columnAdded=!0}function CountBits(a){return a=(a&m1)+(a>>1&m1),a=(a&m2)+(a>>2&m2),a=(a&m4)+(a>>4&m4),a=(a&m8)+(a>>8&m8),a=(a&m16)+(a>>16&m16),a}function matchGlyph(a,b){if(a in b)return b[a];var c=-1,d;for(var e in b)if(b.hasOwnProperty(e)&&e==(e&a)){var f=CountBits(e);f>c&&(c=f,d=b[e])}return c>0?d:(logErrorNoLine("Wasn't able to approximate a glyph value for some tiles, using '.' as a placeholder.",!0),".")}function printLevel(){var a={},b=0;for(var c in state.glyphDict)if(state.glyphDict.hasOwnProperty(c)&&c.length===1){var d=state.glyphDict[c],b=0;for(var e=0;e<d.length;e++){var f=d[e];f>=0&&(b|=1<<f)}a[b]=c;var g=state.layerMasks[state.backgroundlayer],h=b&~g;b in a||(a[b]=c);for(var e=0;e<32;e++){var i=1<<e;if((i&g)!==0){var j=h|i;j in a||(a[j]=c)}}}var k="Printing level contents:<br><br>";for(var l=0;l<level.height;l++){for(var e=0;e<level.width;e++){var m=l+e*level.height,n=level.dat[m],d=matchGlyph(n,a);d in htmlEntityMap&&(d=htmlEntityMap[d]),k+=d}k+="<br>"}consolePrint(k)}function levelEditorClick(a,b){if(mouseCoordY<=-2){var c=editorRowCount-(-mouseCoordY-2)-1,d=mouseCoordX+(screenwidth-1)*c;mouseCoordX===-1?printLevel():mouseCoordX>=0&&d<glyphImages.length&&(glyphSelectedIndex=d,redraw())}else if(mouseCoordX>-1&&mouseCoordY>-1&&mouseCoordX<screenwidth-2&&mouseCoordY<screenheight-2-editorRowCount){var e=glyphImagesCorrespondance[glyphSelectedIndex],f=state.glyphDict[e],g=0;for(var h=0;h<f.length;h++){var i=f[h];i>=0&&(g|=1<<i)}var j=state.layerMasks[state.backgroundlayer];(g&j)===0&&(g|=1<<state.backgroundid);var k=mouseCoordY+mouseCoordX*level.height;level.dat[k]=g,redraw()}else b&&(mouseCoordX===-1?(addLeftColumn(),canvasResize()):mouseCoordX===screenwidth-2&&(addRightColumn(),canvasResize()),mouseCoordY===-1?(addTopRow(),canvasResize()):mouseCoordY===screenheight-2-editorRowCount&&(addBottomRow(),canvasResize()))}function levelEditorRightClick(a,b){if(mouseCoordY===-2)mouseCoordX<=glyphImages.length&&(glyphSelectedIndex=mouseCoordX,redraw());else if(mouseCoordX>-1&&mouseCoordY>-1&&mouseCoordX<screenwidth-2&&mouseCoordY<screenheight-2-editorRowCount){var c=glyphImagesCorrespondance[glyphSelectedIndex],d=state.glyphDict[c],e=1<<state.backgroundid,f=mouseCoordY+mouseCoordX*level.height;level.dat[f]=e,redraw()}else b&&(mouseCoordX===-1?(removeLeftColumn(),canvasResize()):mouseCoordX===screenwidth-2&&(removeRightColumn(),canvasResize()),mouseCoordY===-1?(removeTopRow(),canvasResize()):mouseCoordY===screenheight-2-editorRowCount&&(removeBottomRow(),canvasResize()))}function onMouseDown(a){if(a.button===0&&!a.ctrlKey&&!a.metaKey){lastDownTarget=a.target,keybuffer=[];if(a.target===canvas){setMouseCoord(a),dragging=!0,rightdragging=!1;if(levelEditorOpened)return levelEditorClick(a,!0)}dragging=!1,rightdragging=!1}else if(a.button===2||a.button===0&&(a.ctrlKey||a.metaKey)){dragging=!1,rightdragging=!0;if(levelEditorOpened)return levelEditorRightClick(a,!0)}}function rightClickCanvas(a){return prevent(a)}function onMouseUp(a){dragging=!1,rightdragging=!1}function onKeyDown(a){a=a||window.event;if(keybuffer.indexOf(a.keyCode)>=0)return;lastDownTarget===canvas&&keybuffer.indexOf(a.keyCode)===-1&&(keybuffer.splice(keyRepeatIndex,0,a.keyCode),keyRepeatTimer=0,checkKey(a,!0)),canDump===!0&&(a.keyCode===74&&(a.ctrlKey||a.metaKey)?dumpTestCase():a.keyCode===75&&(a.ctrlKey||a.metaKey)&&makeGIF())}function relMouseCoords(a){var b=0,c=0,d=0,e=0,f=this;do b+=f.offsetLeft-f.scrollLeft,c+=f.offsetTop-f.scrollTop;while(f=f.offsetParent);return d=a.pageX-b,e=a.pageY-c,{x:d,y:e}}function onKeyUp(a){a=a||window.event;var b=keybuffer.indexOf(a.keyCode);b>=0&&(keybuffer.splice(b,1),keyRepeatIndex>=b&&keyRepeatIndex--)}function setMouseCoord(a){var b=canvas.relMouseCoords(a);mouseCoordX=b.x-xoffset,mouseCoordY=b.y-yoffset,mouseCoordX=Math.floor(mouseCoordX/cellwidth),mouseCoordY=Math.floor(mouseCoordY/cellheight)}function mouseMove(a){levelEditorOpened&&(setMouseCoord(a),dragging?levelEditorClick(a,!1):rightdragging&&levelEditorRightClick(a,!1)),redraw()}function mouseOut(){}function prevent(a){return a.preventDefault&&a.preventDefault(),a.stopImmediatePropagation&&a.stopImmediatePropagation(),a.stopPropagation&&a.stopPropagation(),a.returnValue=!1,!1}function checkKey(a,b){if(winning)return;var c=-1;switch(a.keyCode){case 65:case 37:c=1;break;case 38:case 87:c=0;break;case 68:case 39:c=3;break;case 83:case 40:c=2;break;case 13:case 32:case 67:case 88:c=4;break;case 85:case 90:if(textMode===!1)return canDump===!0&&inputHistory.push("undo"),DoUndo(),prevent(a);break;case 82:if(textMode===!1)return canDump===!0&&inputHistory.push("restart"),DoRestart(),prevent(a);break;case 27:if(titleScreen===!1)return goToTitleScreen(),tryPlayTitleSound(),canvasResize(),prevent(a);break;case 69:if(canOpenEditor)return levelEditorOpened=!levelEditorOpened,canvasResize(),prevent(a);break;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:if(levelEditorOpened&&b){var d=9;return a.keyCode>=49&&(d=a.keyCode-49),d<glyphImages.length?glyphSelectedIndex=d:consolePrint("Trying to select tile outside of range in level editor."),canvasResize(),prevent(a)}}if(textMode){if(state.levels.length!==0)if(titleScreen){if(titleMode===0)c===4&&b&&titleSelected===!1&&(tryPlayStartGameSound(),titleSelected=!0,messageselected=!1,timer=0,quittingTitleScreen=!0,generateTitleScreen(),canvasResize());else if(c==4&&b)titleSelected===!1&&(tryPlayStartGameSound(),titleSelected=!0,messageselected=!1,timer=0,quittingTitleScreen=!0,generateTitleScreen(),redraw());else if(c===0||c===2)titleSelection=1-titleSelection,generateTitleScreen(),redraw()}else if(c==4&&b){if(unitTesting){nextLevel();return}messageselected===!1&&(messageselected=!0,timer=0,quittingMessageScreen=!0,tryPlayCloseMessageSound(),titleScreen=!1,drawMessageScreen())}}else if(!againing&&c>=0)return canDump===!0&&inputHistory.push(c),c===4&&"noaction"in state.metadata||processInput(c),prevent(a)}function update(){timer+=deltatime,quittingTitleScreen&&timer/1e3>.3&&(quittingTitleScreen=!1,nextLevel()),againing&&timer>againinterval&&(againing=!1,processInput(-1)),quittingMessageScreen&&timer/1e3>.15&&(quittingMessageScreen=!1,messagetext===""?nextLevel():(messagetext="",textMode=!1,titleScreen=!1,titleMode=curlevel>0?1:0,titleSelected=!1,titleSelection=0,canvasResize(),checkWin())),winning&&timer/1e3>.5&&(winning=!1,nextLevel());if(keybuffer.length>0){keyRepeatTimer+=deltatime;if(keyRepeatTimer>repeatinterval/Math.sqrt(keybuffer.length)){keyRepeatTimer=0,keyRepeatIndex=(keyRepeatIndex+1)%keybuffer.length;var a=keybuffer[keyRepeatIndex];checkKey({keyCode:a},!1)}}autotickinterval>0&&!textMode&&(autotick+=deltatime,autotick>autotickinterval&&(autotick=0,autoTickGame()))}var keyRepeatTimer=0,keyRepeatIndex=0,dragging=!1,rightdragging=!1,columnAdded=!1,m1=1431655765,m2=858993459,m4=252645135,m8=16711935,m16=65535,hff=4294967295,h01=16843009,htmlEntityMap={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};HTMLCanvasElement.prototype.relMouseCoords=relMouseCoords;var mouseCoordX=0,mouseCoordY=0;document.addEventListener("mousedown",onMouseDown,!1),document.addEventListener("mouseup",onMouseUp,!1),document.addEventListener("keydown",onKeyDown,!1),document.addEventListener("keyup",onKeyUp,!1),setInterval(function(){update()},deltatime) </script> <script>function unloadGame(){state=introstate,level={width:5,height:5,layerCount:2,dat:[1,3,3,1,1,2,2,3,3,1,2,1,2,2,3,3,1,1,2,2,3,2,1,3,2,1,3,2,1,3,1,3,3,1,1,2,2,3,3,1,2,1,2,2,3,3,1,1,2,2],movementMask:[1,3,3,1,1,2,2,3,3,1,2,1,2,2,3,3,1,1,2,2,3,2,1,3,2,1,3,2,1,3,1,3,3,1,1,2,2,3,3,1,2,1,2,2,3,3,1,1,2,2],rigidGroupIndexMask:[],rigidMovementAppliedMask:[],bannedGroup:[]},generateTitleScreen(),canvasResize(),redraw()}function generateTitleScreen(){titleMode=curlevel>0?1:0;if(state.levels.length==0){titleImage=intro_template;return}var a="PuzzleScript Game";state.metadata.title!==undefined&&(a=state.metadata.title.toUpperCase()),titleMode==0?titleSelected?titleImage=deepClone(titletemplate_firstgo_selected):titleImage=deepClone(titletemplate_firstgo):titleSelection==0?titleSelected?titleImage=deepClone(titletemplate_select0_selected):titleImage=deepClone(titletemplate_select0):titleSelected?titleImage=deepClone(titletemplate_select1_selected):titleImage=deepClone(titletemplate_select1);var b="noaction"in state.metadata,c="noundo"in state.metadata,d="norestart"in state.metadata;c&&d?titleImage[11]="..................................":c?titleImage[11]=".R to restart.....................":d&&(titleImage[11]=".Z to undo....................."),b&&(titleImage[10]="..................................");for(var e=0;e<titleImage.length;e++)titleImage[e]=titleImage[e].replace(/\./g," ");var f=titleImage[0].length,g=wordwrap(a,titleImage[0].length);for(var e=0;e<g.length;e++){var h=g[e],i=h.length,j=(f-i)/2|0,k=f-i-j,l=titleImage[1+e];titleImage[1+e]=l.slice(0,j)+h+l.slice(j+h.length)}if(state.metadata.author!==undefined){var m="by "+state.metadata.author;attributionsplit=wordwrap(m,titleImage[0].length);for(var e=0;e<attributionsplit.length;e++){var n=attributionsplit[e],l=titleImage[3+e];titleImage[3+e]=l.slice(0,f-n.length-1)+n+l[l.length-1]}}}function deepClone(a){if(!a)return a;var b=[Number,String,Boolean],c;b.forEach(function(b){a instanceof b&&(c=b(a))});if(typeof c=="undefined")if(Object.prototype.toString.call(a)==="[object Array]")c=[],a.forEach(function(a,b,d){c[b]=deepClone(a)});else if(typeof a=="object")if(a.nodeType&&typeof a.cloneNode=="function")var c=a.cloneNode(!0);else if(!a.prototype)if(a instanceof Date)c=new Date(a);else{c={};for(var d in a)c[d]=deepClone(a[d])}else c=a;else c=a;return c}function wordwrap(a,b){b=b||75;var c=!0;if(!a)return a;var d=".{1,"+b+"}(\\s|$)"+(c?"|.{"+b+"}|.+$":"|\\S+?(\\s|$)");return a.match(RegExp(d,"g"))}function drawMessageScreen(){titleMode=0,textMode=!0,titleImage=deepClone(messagecontainer_template);for(var a=0;a<titleImage.length;a++)titleImage[a]=titleImage[a].replace(/\./g," ");var b=titleImage[0].length,c;if(messagetext===""){var d=state.levels[curlevel];c=d.message.trim()}else c=messagetext;splitMessage=wordwrap(c,titleImage[0].length);for(var a=0;a<splitMessage.length;a++){var e=splitMessage[a],f=5-(splitMessage.length/2|0)+a,g=e.length,h=(b-g)/2|0,i=b-g-h,j=titleImage[f];titleImage[f]=j.slice(0,h)+e+j.slice(h+e.length)}quittingMessageScreen&&(titleImage[10]=titleImage[9]),canvasResize()}function loadLevelFromState(a,b){forceRegenImages=!0,titleScreen=!1,titleMode=curlevel>0?1:0,titleSelected=!1,titleSelection=0,curlevel=b,againing=!1;var c=a.levels[b];if(c===null){consolePrint("Trying to access a level that doesn't exist.");return}if(c.message===undefined){titleMode=0,textMode=!1,level={width:c.w,height:c.h,layerCount:c.layerCount,dat:c.dat.concat([]),movementMask:c.dat.concat([]),rigidMovementAppliedMask:c.dat.concat([]),rigidGroupIndexMask:c.dat.concat([]),rowCellContents:[],colCellContents:[],mapCellContents:0};for(var d=0;d<level.height;d++)level.rowCellContents[d]=0;for(var d=0;d<level.width;d++)level.colCellContents[d]=0;for(var d=0;d<level.movementMask.length;d++)level.movementMask[d]=0,level.rigidMovementAppliedMask[d]=0,level.rigidGroupIndexMask[d]=0;"run_rules_on_level_start"in a.metadata&&processInput(-1,!0),backups=[],restartTarget=backupLevel(),b===0?tryPlayStartLevelSound():tryPlayStartLevelSound()}else tryPlayShowMessageSound(),drawMessageScreen(),canvasResize();canDump===!0&&(inputHistory=[])}function autoTickGame(){processInput(-1)}function tick(){redraw()}function tryPlaySimpleSound(a){if(state.sfx_Events[a]!==undefined){var b=state.sfx_Events[a];playSeed(b)}}function tryPlayTitleSound(){tryPlaySimpleSound("titlescreen")}function tryPlayStartGameSound(){tryPlaySimpleSound("startgame")}function tryPlayEndGameSound(){tryPlaySimpleSound("endgame")}function tryPlayStartLevelSound(){tryPlaySimpleSound("startlevel")}function tryPlayEndLevelSound(){tryPlaySimpleSound("endlevel")}function tryPlayUndoSound(){tryPlaySimpleSound("undo")}function tryPlayRestartSound(){tryPlaySimpleSound("restart")}function tryPlayShowMessageSound(){tryPlaySimpleSound("showmessage")}function tryPlayCloseMessageSound(){tryPlaySimpleSound("closemessage")}function backupLevel(){return level.dat.concat([])}function setGameState(a,b){oldflickscreendat=[],timer=0,autotick=0,winning=!1,againing=!1,messageselected=!1,b===undefined&&(b=["restart"]),state.levels.length==0&&b.length>0&&b[0]==="rebuild"&&(b=["restart"]),state=a,window.console.log("setting game state :D "),backups=[],sprites=[];for(var c in state.objects)if(state.objects.hasOwnProperty(c)){var d=state.objects[c],e={colors:d.colors,dat:d.spritematrix};sprites[d.id]=e}state.metadata.realtime_interval!==undefined?(autotick=0,autotickinterval=state.metadata.realtime_interval*1e3,logBetaMessage("realtime_interval is a beta feature, its behaviour may change before it ends up in launch. I would advise against circulating this game for wider distribution before then.",!0)):(autotick=0,autotickinterval=0),state.metadata.key_repeat_interval!==undefined?repeatinterval=state.metadata.key_repeat_interval*1e3:repeatinterval=150,state.metadata.again_interval!==undefined?againinterval=state.metadata.again_interval*1e3:againinterval=150;switch(b[0]){case"restart":winning=!1,timer=0,titleScreen=!0,tryPlayTitleSound(),textMode=!0,titleSelection=0,titleSelected=!1,quittingMessageScreen=!1,quittingTitleScreen=!1,messageselected=!1,titleMode=0,curlevel>0&&(titleMode=1),generateTitleScreen();break;case"rebuild":break;case"loadLevel":var f=b[1];curlevel=h,winning=!1,timer=0,titleScreen=!1,textMode=!1,titleSelection=0,titleSelected=!1,quittingMessageScreen=!1,quittingTitleScreen=!1,messageselected=!1,titleMode=0,loadLevelFromState(state,f);break;case"levelline":var g=b[1];for(var h=state.levels.length-1;h>=0;h--){var i=state.levels[h];if(i.lineNumber<=g+1){curlevel=h,winning=!1,timer=0,titleScreen=!1,textMode=!1,titleSelection=0,titleSelected=!1,quittingMessageScreen=!1,quittingTitleScreen=!1,messageselected=!1,titleMode=0,loadLevelFromState(state,h);break}}}canDump===!0&&(inputHistory=[]),canvasResize();if(canYoutube&&"youtube"in state.metadata){var j=state.metadata.youtube,k="https://youtube.googleapis.com/v/"+j+"?autoplay=1&loop=1&playlist="+j;ifrm=document.createElement("IFRAME"),ifrm.setAttribute("src",k),ifrm.style.visibility="hidden",ifrm.style.width="500px",ifrm.style.height="500px",ifrm.style.position="absolute",ifrm.style.top="-1000px",ifrm.style.left="-1000px",document.body.appendChild(ifrm)}}function restoreLevel(a){oldflickscreendat=[],level.dat=a.concat([]),level.dat=a.concat([]);for(var b=0;b<level.dat.length;b++)level.movementMask[b]=0,level.rigidMovementAppliedMask[b]=0,level.rigidGroupIndexMask[b]=0;for(var b=0;b<level.height;b++)level.rowCellContents[b]=0;for(var b=0;b<level.width;b++)level.colCellContents[b]=0;againing=!1,messagetext="",level.commandQueue=[],redraw()}function DoRestart(a){if(a===!1&&"norestart"in state.metadata)return;a===!1&&backups.push(backupLevel()),restoreLevel(restartTarget),tryPlayRestartSound(),level.commandQueue=[]}function DoUndo(a){if("noundo"in state.metadata&&a!==!0)return;if(backups.length>0){var b=backups[backups.length-1];restoreLevel(b),backups=backups.splice(0,backups.length-1),tryPlayUndoSound()}}function getPlayerPositions(){var a=[],b=state.playerMask;for(i=0;i<level.dat.length;i++){var c=level.dat[i];(b&c)!=0&&a.push(i)}return a}function getLayersOfMask(a){var b=[];for(var c=0;c<state.objectCount;c++)if((a&1<<c)!=0){var d=state.idDict[c],e=state.objects[d];b.push(e.layer)}return b}function getLayerMask(a){var b=0;for(var c=0;c<state.objectCount;c++)if((a&1<<c)!=0){var d=state.idDict[c],e=state.objects[d];b|=parseInt("11111",2)<<5*e.layer}return b}function moveEntitiesAtIndex(a,b,c){var d=level.dat[a],e=b&d,f=getLayersOfMask(e),g=level.movementMask[a];for(var h=0;h<f.length;h++){var i=f[h];g|=c<<i*5}level.movementMask[a]=g}function startMovement(a){var b=!1,c=getPlayerPositions();for(var d=0;d<c.length;d++){var e=c[d];moveEntitiesAtIndex(e,state.playerMask,a)}return c}function repositionEntitiesOnLayer(a,b,c){var d=dirMasksDelta[c],e=d[0],f=d[1],g=a/level.height|0,h=a%level.height|0,i=level.width-1,j=level.height-1;if(g===0&&e<0||g===i&&e>0||h===0&&f<0||h===j&&f>0)return!1;var k=(a+d[1]+d[0]*level.height)%level.dat.length,l=state.layerMasks[b],m=level.dat[k],n=m&l,o=level.dat[a];if(n!=0)return!1;var p=o&l;level.dat[a]=o&~l,level.dat[k]=m|p;var q=k/level.height|0,r=k%level.height;level.colCellContents[q]=level.colCellContents[q]|p,level.rowCellContents[r]=level.rowCellContents[r]|p,level.mapCellContents=level.mapCellContents|p;for(var s=0;s<state.sfx_MovementMasks.length;s++){var t=state.sfx_MovementMasks[s],u=t.objectMask;if((u&o)!==0){var v=level.movementMask[a],w=t.directionMask;(v&w)!==0&&seedsToPlay_CanMove.indexOf(t.seed)===-1&&seedsToPlay_CanMove.push(t.seed)}}return!0}function randomDir(){return dirMask_random[Math.floor(Math.random()*dirMask_random.length)]}function repositionEntitiesAtCell(a){var b=level.movementMask[a],c=!1;for(var d=0;d<6;d++){var e=parseInt("11111",2)&b>>5*d;if(e!=0){var f=repositionEntitiesOnLayer(a,d,e);f&&(b&=~(e<<5*d)),c=f||c}}return level.movementMask[a]=b,c}function ruleMovementMaskAgrees(a,b){return a===0?!0:(a&b)!==0}function cellRowMatchesWildCard_ParticularK(a,b,c,d){var e=b[0],f=b[1],g=b[2],h=b[4],i=dirMasksDelta[a],j=level.movementMask[c],k=level.dat[c],l,m=[];if((f&k)==f&&(g&k)==0&&(e===0?!0:(e&j)!==0)&&(h&j)==0){var n=c;for(var o=6;o<b.length;o+=6){n=(n+i[1]+i[0]*level.height)%level.dat.length;var j=level.movementMask[n],p=b[o+0],k=level.dat[n],q=b[o+1],r=b[o+2],s=b[o+4];if(p===ellipsisDirection){var t=n;t=(t+i[1]*d+i[0]*d*level.height+level.dat.length)%level.dat.length;for(var u=o+6;u<b.length;u+=6){j=level.movementMask[t],k=level.dat[t],p=b[u+0],q=b[u+1],r=b[u+2],s=b[u+4];if((q&k)!=q||(r&k)!=0||(p===0?!1:(p&j)===0)||(s&j)!=0)break;t=(t+i[1]+i[0]*level.height)%level.dat.length}u>=b.length&&m.push([c,d]);break}if((q&k)!=q||(r&k)!=0||(p===0?!1:(p&j)===0)||(s&j)!=0)break}}return m.length>0}function cellRowMatchesWildCard(a,b,c,d){var e=b[0],f=b[1],g=b[2],h=b[4],i=dirMasksDelta[a],j=level.movementMask[c],k=level.dat[c],l,m=[];if((f&k)==f&&(g&k)==0&&(e===0?!0:(e&j)!==0)&&(h&j)==0){var n=c;for(var o=6;o<b.length;o+=6){n=(n+i[1]+i[0]*level.height)%level.dat.length;var j=level.movementMask[n],p=b[o+0],k=level.dat[n],q=b[o+1],r=b[o+2],s=b[o+4];if(p===ellipsisDirection){for(var t=0;t<d;t++){var u=n;u=(u+i[1]*t+i[0]*t*level.height+level.dat.length)%level.dat.length;for(var v=o+6;v<b.length;v+=6){j=level.movementMask[u],k=level.dat[u],p=b[v+0],q=b[v+1],r=b[v+2],s=b[v+4];if((q&k)!=q||(r&k)!=0||(p===0?!1:(p&j)===0)||(s&j)!=0)break;u=(u+i[1]+i[0]*level.height)%level.dat.length}v>=b.length&&m.push([c,t])}break}if((q&k)!=q||(r&k)!=0||(p===0?!1:(p&j)===0)||(s&j)!=0)break}}return m}function checkThing(a,b,c,d,e,f){return(a&f)==a&&(c&f)==0&&ruleMovementMaskAgrees(b,e)&&(d&e)==0}function cellRowMatches(a,b,c,d){var e=b[0],f=b[1],g=b[2],h=b[4],i=dirMasksDelta[a],j=level.movementMask[c],k=level.dat[c],l;if((f&k)==f&&(g&k)==0&&(e===0?!0:(e&j)!==0)&&(h&j)==0){var m=c;for(var n=6;n<b.length;n+=6){m=(m+i[1]+i[0]*level.height)%level.dat.length;var j=level.movementMask[m],o=b[n+0];o===ellipsisDirection&&(m=(m+i[1]*d+i[0]*d*level.height)%level.dat.length);var k=level.dat[m],p=b[n+1],q=b[n+2],r=b[n+4];if((p&k)!=p||(q&k)!=0||(o===0?!1:(o&j)===0)||(r&j)!=0)break}if(n>=b.length)return!0}return!1}function matchCellRow(a,b,c){var d=[];if((c&level.mapCellContents)===0)return d;var e=0,f=level.width,g=0,h=level.height,i=b.length/6|0;switch(a){case 1:g+=i-1;break;case 2:h-=i-1;break;case 4:e+=i-1;break;case 8:f-=i-1;break;default:window.console.log("EEEP "+a)}var j=a>2;if(j)for(var k=g;k<h;k++){if((level.rowCellContents[k]&c)===0)continue;for(var l=e;l<f;l++){var m=l*level.height+k;cellRowMatches(a,b,m)&&d.push(m)}}else for(var l=e;l<f;l++){if((level.colCellContents[l]&c)===0)continue;for(var k=g;k<h;k++){var m=l*level.height+k;cellRowMatches(a,b,m)&&d.push(m)}}return d}function matchCellRowWildCard(a,b,c){var d=[];if((c&level.mapCellContents)===0)return d;var e=0,f=level.width,g=0,h=level.height,i=(b.length/6|0)-1;switch(a){case 1:g+=i-1;break;case 2:h-=i-1;break;case 4:e+=i-1;break;case 8:f-=i-1;break;default:window.console.log("EEEP2 "+a)}var j=a>2;if(j)for(var k=g;k<h;k++){if((level.rowCellContents[k]&c)===0)continue;for(var l=e;l<f;l++){var m=l*level.height+k,n;switch(a){case 1:n=k-i+2;break;case 2:n=level.height-(k+i)+1;break;case 4:n=l-i+2;break;case 8:n=level.width-(l+i)+1;break;default:window.console.log("EEEP2 "+a)}d=d.concat(cellRowMatchesWildCard(a,b,m,n))}}else for(var l=e;l<f;l++){if((level.colCellContents[l]&c)===0)continue;for(var k=g;k<h;k++){var m=l*level.height+k,n;switch(a){case 1:n=k-i+2;break;case 2:n=level.height-(k+i)+1;break;case 4:n=l-i+2;break;case 8:n=level.width-(l+i)+1;break;default:window.console.log("EEEP2 "+a)}d=d.concat(cellRowMatchesWildCard(a,b,m,n))}}return d}function generateTuples(a){var b=[[]];for(var c=0;c<a.length;c++){var d=a[c],e=[];for(var f=0;f<d.length;f++){var g=d[f];for(var h=0;h<b.length;h++){var i=b[h],j=i.concat([g]);e.push(j)}}b=e}return b}function commitPreservationState(a){var b={ruleGroupIndex:a,dat:level.dat.concat([]),levelMovementMask:level.movementMask.concat([]),rigidGroupIndexMask:level.rigidGroupIndexMask.concat([]),rigidMovementAppliedMask:level.rigidMovementAppliedMask.concat([]),bannedGroup:level.bannedGroup.concat([])};return rigidBackups[a]=b,b}function restorePreservationState(a){level.dat=a.dat.concat([]),level.movementMask=a.levelMovementMask.concat([]),level.rigidGroupIndexMask=a.rigidGroupIndexMask.concat([]),level.rigidMovementAppliedMask=a.rigidMovementAppliedMask.concat([]),sfxCreateMask=0,sfxDestroyMask=0}function findRuleMatches(a){var b=[],c=a[11];for(var d=0;d<a[1].length;d++){var e=a[1][d];if(a[5][d])var f=matchCellRowWildCard(a[0],e,c[d]);else var f=matchCellRow(a[0],e,c[d]);if(f.length==0)return[];b.push(f)}return b}function applyRuleAt(a,b,c,d){if(d){var e=!0;for(var f=0;f<a[1].length;f++)if(a[5][f]){if(cellRowMatchesWildCard_ParticularK(a[0],a[1][f],c[f][0],c[f][1])===!1){e=!1;break}}else if(cellRowMatches(a[0],a[1][f],c[f])===!1){e=!1;break}if(e===!1)return!1}var g=!1,h=!1;for(var f=0;f<a[1].length;f++){var i=a[1][f],j=a[2][f],k=a[5][f]?c[f][0]:c[f];for(var l=0;l<i.length;l+=6){var m=i[l+0];if(m===ellipsisDirection){var n=c[f][1];k=(k+b[1]*n+b[0]*n*level.height)%level.dat.length;continue}var o=i[l+1],p=i[l+2],q=i[l+3],r=i[l+4],s=j[l+0],t=j[l+1],u=j[l+2],v=j[l+3],w=j[l+4],x=j[l+5],y=i[l+5];if(x!==0){var z=[];for(var A=0;A<32;A++)(x&1<<A)!==0&&z.push(A);var B=z[Math.floor(Math.random()*z.length)],C=state.idDict[B],D=state.objects[C],E=state.layerMasks[D.layer],F=31<<5*D.layer;t|=1<<B,u|=state.layerMasks[D.layer],w|=F}if(y!==0)for(var G=0;G<6;G++){var H=parseInt("11111",2)&y>>5*G;if(H!==0){var I=randomDir();s|=I<<5*G}}var J=level.dat[k],K=level.movementMask[k],L=J,M=K;J&=~o,K&=~m,J&=~u,K&=~q,s!==0&&(K&=~v),J|=t,K&=~w,K|=s;var N=!1,O=0,P=0;if(a[7]){h=!0;var Q=a[6],R=state.groupNumber_to_RigidGroupIndex[Q];R++;var S=R+(R<<5)+(R<<10)+(R<<15)+(R<<20)+(R<<25);S&=v,O=level.rigidGroupIndexMask[k],P=level.rigidMovementAppliedMask[k];var T=O,U=P;O|=S,P|=v;if(T!==O||U!==P)N=!0}if(L!==J||M!=K||N){g=!0,N&&(level.rigidGroupIndexMask[k]=O,level.rigidMovementAppliedMask[k]=P);var V=J&~L,W=L&~J;sfxCreateMask|=V,sfxDestroyMask|=W,level.dat[k]=J,level.movementMask[k]=K;var X=k/level.height|0,Y=k%level.height;level.colCellContents[X]=level.colCellContents[X]|J,level.rowCellContents[Y]=level.rowCellContents[Y]|J,level.mapCellContents=level.mapCellContents|J}k=(k+b[1]+b[0]*level.height)%level.dat.length}}if(verbose_logging&&g){var Z=a[3],$=dirMaskName[a[0]],_='<font color="green">Rule <a onclick="jumpToLine('+Z.toString()+');" href="javascript:void(0);">'+Z.toString()+"</a> applied.</font>";consolePrint(_)}return g}function tryApplyRule(a,b,c){var d=dirMasksDelta[a[0]],e=findRuleMatches(a);if(e.length===0)return!1;var f=!1;if(a[9]===!1){var g=generateTuples(e);for(var h=0;h<g.length;h++){var i=g[h],j=h>0;f=applyRuleAt(a,d,i,j)||f}}return e.length>0&&queueCommands(a),f}function queueCommands(a){var b=a[8];for(var c=0;c<b.length;c++){var d=b[c],e=!1;if(level.commandQueue.indexOf(d[0])>=0)continue;level.commandQueue.push(d[0]),d[0]==="message"&&(messagetext=d[1])}}function showTempMessage(){keybuffer=[],textMode=!0,titleScreen=!1,quittingMessageScreen=!1,messageselected=!1,tryPlayShowMessageSound(),drawMessageScreen(),canvasResize()}function applyRandomRuleGroup(a){var b=!1,c=[];for(var d=0;d<a.length;d++){var e=a[d],f=findRuleMatches(e);if(f.length>0){var g=generateTuples(f);for(var h=0;h<g.length;h++){var i=g[h];c.push([d,i])}}}if(c.length==0)return!1;var j=c[Math.floor(Math.random()*c.length)],d=j[0],e=a[d],k=dirMasksDelta[e[0]],i=j[1],l=!1,m=applyRuleAt(e,k,i,l);return queueCommands(e),m}function applyRuleGroup(a){var b=a[0][10];if(b)return applyRandomRuleGroup(a);var c=!1,d=!0,e=0;while(d){e++;if(e>200){logErrorNoLine("got caught looping lots in a rule group :O",!0);break}d=!1;for(var f=0;f<a.length;f++){var g=a[f];d=tryApplyRule(g)||d}d&&(c=!0)}return c}function propagateMovements(a){var b=a>0,c=0;for(var d=a;d<state.rules.length;){if(!level.bannedGroup[d]){var e=state.rules[d];b=applyRuleGroup(e)||b}if(b&&state.loopPoint[d]!==undefined){d=state.loopPoint[d],b=!1,c++;if(c>200){var e=state.rules[d];logError("got caught in an endless startloop...endloop vortex, escaping!",e[0][3],!0);break}}else{d++;if(d===state.rules.length&&b&&state.loopPoint[d]!==undefined){d=state.loopPoint[d],b=!1,c++;if(c>200){var e=state.rules[d];logError("got caught in an endless startloop...endloop vortex, escaping!",e[0][3],!0);break}}}}}function propagateLateMovements(){var a=!0,b=0;for(var c=0;c<state.lateRules.length;){if(!level.bannedGroup[c]){var d=state.lateRules[c],e=applyRuleGroup(d);a=e||a}if(a&&state.lateLoopPoint[c]!==undefined){c=state.lateLoopPoint[c],a=!1,b++;if(b>200){var d=state.lateRules[c];logError("got caught in an endless startloop...endloop vortex, escaping!",d[0][3],!0);break}}else{c++;if(c===state.lateRules.length&&a&&state.lateLoopPoint[c]!==undefined){c=state.lateLoopPoint[c],a=!1,b++;if(b>0){var d=state.lateRules[c];logError("got caught in an endless startloop...endloop vortex, escaping!",d[0][3],!0);break}}}}}function resolveMovements(a){var b=!0;while(b){b=!1;for(var c=0;c<level.dat.length;c++){var d=level.movementMask[c];d!=0&&(b=repositionEntitiesAtCell(c)||b)}}var e=!1;for(var c=0;c<level.movementMask.length;c++){var f=level.dat[c],d=level.movementMask[c];if(d!==0){var g=level.rigidMovementAppliedMask[c],h=g&d;if(h!==0)for(var i=0;i<6;i++){var j=parseInt("11111",2)&h>>5*i;if(j!==0){var k=level.rigidGroupIndexMask[c],l=parseInt("11111",2)&k>>5*i;l--;var m=state.rigidGroupIndex_to_GroupIndex[l];level.bannedGroup[m]=!0,e=!0;break}}for(var i=0;i<state.sfx_MovementFailureMasks.length;i++){var n=state.sfx_MovementFailureMasks[i],o=n.objectMask;if((o&f)!==0){var p=n.directionMask;(d&p)!==0&&seedsToPlay_CantMove.indexOf(n.seed)===-1&&seedsToPlay_CantMove.push(n.seed)}}}level.movementMask[c]=0,level.rigidGroupIndexMask[c]=0,level.rigidMovementAppliedMask[c]=0}return e}function calculateRowColMasks(){level.mapCellContents=0;for(var a=0;a<level.width;a++)level.colCellContents[a]=0;for(var b=0;b<level.height;b++)level.rowCellContents[a]=0;for(var a=0;a<level.width;a++)for(var b=0;b<level.height;b++){var c=b+a*level.height,d=level.dat[c];level.mapCellContents=level.mapCellContents|d,level.rowCellContents[b]=level.rowCellContents[b]|d,level.colCellContents[a]=level.colCellContents[a]|d}}function processInput(a,b,c){verbose_logging&&(a===-1?consolePrint("Turn starts with no input."):(consolePrint("======================="),consolePrint("Turn starts with input of "+["up","left","down","right","action"][a]+".")));var d=backupLevel(),e=[];if(a<=4){if(a>=0){switch(a){case 0:a=parseInt("00001",2);break;case 1:a=parseInt("00100",2);break;case 2:a=parseInt("00010",2);break;case 3:a=parseInt("01000",2);break;case 4:a=parseInt("10000",2)}e=startMovement(a)}var f=0,g=!0;level.bannedGroup=[],rigidBackups=[],level.commandQueue=[];var h=0,i=!1,j=commitPreservationState();messagetext="",sfxCreateMask=0,sfxDestroyMask=0,seedsToPlay_CanMove=[],seedsToPlay_CantMove=[],calculateRowColMasks();while(g||i){g=!1,i=!1,f++,verbose_logging&&consolePrint("applying rules"),propagateMovements(h);var k=resolveMovements();k?(i=!0,restorePreservationState(j),h=0):(verbose_logging&&consolePrint("applying late rules"),propagateLateMovements(),h=0)}f>=50&&window.console.log("looped through 50 times, gave up. too many loops!");for(var f=0;f<seedsToPlay_CantMove.length;f++)playSeed(seedsToPlay_CantMove[f]);if(e.length>0&&state.metadata.require_player_movement!==undefined){var l=!1;for(var f=0;f<e.length;f++){var m=e[f],n=level.dat[m];if((n&state.playerMask)===0){l=!0;break}}if(l===!1){consolePrint("require_player_movement set, but no player movement detected, so cancelling turn."),backups.push(d),DoUndo(!0),seedsToPlay_CanMove=[],seedsToPlay_CantMove=[];return}}if(level.commandQueue.indexOf("cancel")>=0){verbose_logging&&consolePrint("CANCEL command executed, cancelling turn."),backups.push(d),DoUndo(!0),seedsToPlay_CanMove=[],seedsToPlay_CantMove=[],redraw();return}if(level.commandQueue.indexOf("restart")>=0)return verbose_logging&&consolePrint("RESTART command executed, reverting to restart state."),backups.push(d),DoRestart(!0),seedsToPlay_CanMove=[],seedsToPlay_CantMove=[],redraw(),!0;for(var f=0;f<seedsToPlay_CanMove.length;f++)playSeed(seedsToPlay_CanMove[f]);for(var f=0;f<state.sfx_CreationMasks.length;f++){var o=state.sfx_CreationMasks[f];(sfxCreateMask&o.objectMask)!==0&&playSeed(o.seed)}for(var f=0;f<state.sfx_DestructionMasks.length;f++){var o=state.sfx_DestructionMasks[f];(sfxDestroyMask&o.objectMask)!==0&&playSeed(o.seed)}for(var f=0;f<level.movementMask.length;f++)level.movementMask[f]=0,level.rigidGroupIndexMask[f]=0,level.rigidMovementAppliedMask[f]=0;var p=!1;for(var f=0;f<level.dat.length;f++)if(level.dat[f]!==d[f]){if(c)return backups.push(d),DoUndo(!0),!0;a!==-1&&backups.push(d),p=!0;break}if(c)return!1;for(var f=0;f<level.commandQueue.length;f++){var q=level.commandQueue[f];q.charAt(1)==="f"&&tryPlaySimpleSound(q),unitTesting===!1&&q==="message"&&showTempMessage()}level.commandQueue.indexOf("again")>=0&&p&&processInput(-1,!0,!0)&&(verbose_logging&&consolePrint("AGAIN command executed, with changes detected: will execute another turn."),againing=!0,timer=0),level.commandQueue.indexOf("checkpoint")>=0&&(verbose_logging&&consolePrint("CHECKPOINT command executed, saving current state to the restart state."),restartTarget=backupLevel()),textMode===!1&&(b===undefined||b===!1)&&(verbose_logging&&consolePrint("Checking win condition."),checkWin()),level.commandQueue=[]}redraw()}function checkWin(){if(levelEditorOpened)return;if(level.commandQueue.indexOf("win")>=0){consolePrint("Win Condition Satisfied"),DoWin();return}var a=!1;if(state.winconditions.length>0){var b=!0;for(var c=0;c<state.winconditions.length;c++){var d=state.winconditions[c],e=d[1],f=d[2],g=!0;switch(d[0]){case-1:for(var h=0;h<level.dat.length;h++){var i=level.dat[h];if((e&i)!==0&&(f&i)!==0){g=!1;break}}break;case 0:var j=!1;for(var h=0;h<level.dat.length;h++){var i=level.dat[h];if((f&i)!==0&&(e&i)!==0){j=!0;break}}j===!1&&(g=!1);break;case 1:for(var h=0;h<level.dat.length;h++){var i=level.dat[h];if((e&i)!==0&&(f&i)===0){g=!1;break}}}g===!1&&(b=!1)}a=b}a&&(consolePrint("Win Condition Satisfied"),DoWin())}function DoWin(){if(winning)return;againing=!1,tryPlayEndLevelSound();if(unitTesting){nextLevel();return}winning=!0,timer=0}function anyMovements(){for(var a=0;a<level.movementMask.length;a++)if(level.movementMask[a]!=0)return!0;return!1}function nextLevel(){keybuffer=[],againing=!1,messagetext="",titleScreen?(titleSelection==0&&(curlevel=0),loadLevelFromState(state,curlevel)):curlevel<state.levels.length-1?(curlevel++,textMode=!1,titleScreen=!1,quittingMessageScreen=!1,messageselected=!1,loadLevelFromState(state,curlevel)):(curlevel=0,goToTitleScreen(),tryPlayEndGameSound()),localStorage[document.URL]=curlevel,canvasResize(),canDump===!0&&(inputHistory=[])}function goToTitleScreen(){againing=!1,messagetext="",titleScreen=!0,textMode=!0,titleSelection=0,generateTitleScreen()}intro_template=["..................................","..................................","..................................","......Puzzle Script Terminal......","..............v 1.0...............","..................................","..................................","..................................",".........insert cartridge.........","..................................","..................................","..................................",".................................."],messagecontainer_template=["..................................","..................................","..................................","..................................","..................................","..................................","..................................","..................................","..................................","..................................","..........X to continue...........","..................................",".................................."],titletemplate_firstgo=["..................................","..................................","..................................","..................................","..................................","..................................","..........#.start game.#..........","..................................","..................................",".arrow keys to move...............",".X to action......................",".Z to undo, R to restart..........",".................................."],titletemplate_select0=["..................................","..................................","..................................","..................................","..................................","...........#.new game.#...........","..................................",".............continue.............","..................................",".arrow keys to move...............",".X to action......................",".Z to undo, R to restart..........",".................................."],titletemplate_select1=["..................................","..................................","..................................","..................................","..................................",".............new game.............","..................................","...........#.continue.#...........","..................................",".arrow keys to move...............",".X to action......................",".Z to undo, R to restart..........",".................................."],titletemplate_firstgo_selected=["..................................","..................................","..................................","..................................","..................................","..................................","###########.start game.###########","..................................","..................................",".arrow keys to move...............",".X to action......................",".Z to undo, R to restart..........",".................................."],titletemplate_select0_selected=["..................................","..................................","..................................","..................................","..................................","############.new game.############","..................................",".............continue.............","..................................",".arrow keys to move...............",".X to action......................",".Z to undo, R to restart..........",".................................."],titletemplate_select1_selected=["..................................","..................................","..................................","..................................","..................................",".............new game.............","..................................","############.continue.############","..................................",".arrow keys to move...............",".X to action......................",".Z to undo, R to restart..........",".................................."];var titleImage=[],titleWidth=titletemplate_select1[0].length,titleHeight=titletemplate_select1.length,textMode=!0,titleScreen=!0,titleMode=0,titleSelection=0,titleSelected=!1,introstate={title:"2D Whale World",attribution:"increpare",objectCount:2,metadata:[],levels:[],bgcolor:"#000000",fgcolor:"#FFFFFF"},state=introstate,splitMessage=[],sprites=[{color:"#423563",dat:[[1,1,1,1,1],[1,0,0,0,1],[1,0,0,0,1],[1,0,0,0,1],[1,1,1,1,1]]},{color:"#252342",dat:[[0,0,1,0,0],[1,1,1,1,1],[0,0,1,0,0],[0,1,1,1,0],[0,1,0,1,0]]}];generateTitleScreen(),canvasResize();var backups=[],restartTarget,messagetext="",zoomscreen=!1,flickscreen=!1,screenwidth=0,screenheight=0,dirMasksDelta={1:[0,-1],2:[0,1],4:[-1,0],8:[1,0],15:[0,0],16:[0,0],3:[0,0]},dirMaskName={1:"up",2:"down",4:"left",8:"right",15:"?",16:"action",3:"no"},seedsToPlay_CanMove=[],seedsToPlay_CantMove=[],dirMask_random=[parseInt("00001",2),parseInt("00010",2),parseInt("00100",2),parseInt("01000",2)],randomDirMask=parseInt("00101",2),ellipsisDirection=1<<31,randomEntityMask=parseInt("00101",2);propagationState={ruleGroupIndex:0,levelDat:[],levelMovementMask:[],rigidGroupIndexMask:[],rigidMovementAppliedMask:[],bannedGroup:[]};var rigidBackups=[],sfxCreateMask=0,sfxDestroyMask=0 </script> <script>onmousemove="mouseMove(event)",onmouseout="mouseOut()";var el=document.getElementById("gameCanvas");el.addEventListener?(el.addEventListener("contextmenu",rightClickCanvas,!1),el.addEventListener("mousemove",mouseMove,!1),el.addEventListener("mouseout",mouseOut,!1)):(el.attachEvent("oncontextmenu",rightClickCanvas),el.attachEvent("onmousemove",mouseMove),el.attachEvent("onmouseout",mouseOut)) </script> <script>var loadableGameDat={"objects":{"background":{"lineNumber":12,"colors":["#B2DCEF"],"spritematrix":[[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0]],"layer":0,"id":0},"exit":{"lineNumber":16,"colors":["#a46422","#000000"],"spritematrix":[["1","1","1","1","1"],["1","0","0","0","1"],["1","0","0","1","1"],["1","0","0","0","1"],["1","1","1","1","1"]],"layer":1,"id":1},"wall":{"lineNumber":25,"colors":["#cccccc","#be2633"],"spritematrix":[["1","1","1","0","1"],["0","0","0","0","0"],["1","1","1","1","0"],["0","0","0","0","0"],["1","1","1","0","1"]],"layer":4,"id":9},"player":{"lineNumber":33,"colors":["#1B2632"],"spritematrix":[[-1,"0","0","0",-1],[-1,"0","0","0",-1],["0","0","0","0","0"],[-1,"0","0","0",-1],[-1,"0",-1,"0",-1]],"layer":4,"id":10},"box":{"lineNumber":41,"colors":["#FFFFFF","#000000"],"spritematrix":[["1","1","1","1","1"],["1","0","0","0","1"],["1","0","0","0","1"],["1","0","0","0","1"],["1","1","1","1","1"]],"layer":4,"id":11},"tryclimbmarker":{"lineNumber":50,"colors":["#FFFFFF"],"spritematrix":[["0",-1,-1,-1,"0"],[-1,"0",-1,"0",-1],[-1,-1,"0",-1,-1],[-1,"0",-1,"0",-1],["0",-1,-1,-1,"0"]],"layer":1,"id":2},"cantclimbmarker":{"lineNumber":58,"colors":["#FFFFFF"],"spritematrix":[["0",-1,-1,-1,"0"],[-1,"0",-1,"0",-1],[-1,-1,"0",-1,-1],[-1,"0",-1,"0",-1],["0",-1,-1,-1,"0"]],"layer":1,"id":3},"liftcheckmarker":{"lineNumber":68,"colors":["#FFFFFF"],"spritematrix":[["0",-1,-1,-1,"0"],[-1,"0",-1,"0",-1],[-1,-1,"0",-1,-1],[-1,"0",-1,"0",-1],["0",-1,-1,-1,"0"]],"layer":2,"id":4},"liftedmarker":{"lineNumber":76,"colors":["#be2633"],"spritematrix":[[-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1]],"layer":2,"id":5},"trydropmarker":{"lineNumber":84,"colors":["#FFFFFF"],"spritematrix":[["0",-1,-1,-1,"0"],[-1,"0",-1,"0",-1],[-1,-1,"0",-1,-1],[-1,"0",-1,"0",-1],["0",-1,-1,-1,"0"]],"layer":2,"id":6},"finishdropmarker":{"lineNumber":92,"colors":["#FFFFFF"],"spritematrix":[["0",-1,-1,-1,"0"],[-1,"0",-1,"0",-1],[-1,-1,"0",-1,-1],[-1,"0",-1,"0",-1],["0",-1,-1,-1,"0"]],"layer":2,"id":7},"fallingmarker":{"lineNumber":101,"colors":["#FFFFFF"],"spritematrix":[["0",-1,-1,-1,"0"],[-1,"0",-1,"0",-1],[-1,-1,"0",-1,-1],[-1,"0",-1,"0",-1],["0",-1,-1,-1,"0"]],"layer":3,"id":8},"faceleftmarker":{"lineNumber":110,"colors":["#FFFFFF"],"spritematrix":[[-1,-1,-1,-1,-1],[-1,"0",-1,-1,-1],[-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1]],"layer":5,"id":12},"facerightmarker":{"lineNumber":118,"colors":["#FFFFFF"],"spritematrix":[[-1,-1,-1,-1,-1],[-1,-1,-1,"0",-1],[-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1]],"layer":5,"id":13},"faceerrormarker":{"lineNumber":126,"colors":["#FFFFFF"],"spritematrix":[[-1,-1,-1,-1,-1],[-1,"0","0","0",-1],[-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1]],"layer":5,"id":14}},"collisionLayers":[["background"],["exit","tryclimbmarker","cantclimbmarker"],["liftcheckmarker","liftedmarker","trydropmarker","finishdropmarker"],["fallingmarker"],["wall","player","box"],["faceleftmarker","facerightmarker","faceerrormarker"]],"legend_synonyms":[[".","background",139],["#","wall",140],["e","exit",144],["o","box",145]],"legend_aggregates":[["<","player","faceleftmarker"],[">","player","facerightmarker"]],"legend_properties":[["facemarker","faceleftmarker","facerightmarker","faceerrormarker"],["gravityobject","player","box"],["platform","box","wall"]],"sounds":[["endlevel","4271703",157]],"rules":[[[8,[[0,0,2560,0,0,0,4194304,1056,0,32505856,0,0]],[[0,0,0,0,0,0,4198400,1056,3824,32537600,0,0]],186,false,[false],186,false,[],false,false,[1056]]],[[8,[[8388608,1056,0,32505856,0,0,0,0,2560,0,0,0]],[[8396800,1056,3824,32537600,0,0,0,0,0,0,0,0]],187,false,[false],187,false,[],false,false,[1056]]],[[2,[[2097152,1056,0,32505856,0,0,0,0,2560,0,0,0]],[[2099200,1056,3824,32537600,0,0,0,0,0,0,0,0]],188,false,[false],188,false,[],false,false,[1056]]],[[2,[[0,0,512,0,0,0,1048576,1056,0,32505856,0,0]],[[0,0,0,0,0,0,1049600,1056,3824,32537600,0,0]],189,false,[false],189,false,[],false,false,[1056]]],[[8,[[0,0,0,0,0,0,16777216,5152,0,32505856,0,0]],[[0,64,240,0,0,0,16777216,5152,32496,32505856,0,0]],192,false,[false],192,false,[],false,false,[5152]]],[[8,[[16777216,9248,0,32505856,0,0,0,0,0,0,0,0]],[[16777216,9248,32496,32505856,0,0,0,64,240,0,0,0]],193,false,[false],193,false,[],false,false,[9248]]],[[2,[[0,2048,0,0,0,0,0,64,0,0,0,0]],[[0,2048,3584,0,0,0,0,0,0,0,0,0]],194,false,[false],194,false,[],false,false,[2112]],[2,[[0,512,0,0,0,0,0,64,0,0,0,0]],[[0,512,3584,0,0,0,0,0,0,0,0,0]],194,false,[false],194,false,[],false,false,[576]]],[[2,[[0,2,0,0,0,0,0,64,0,0,0,0]],[[0,2,14,0,0,0,0,0,0,0,0,0]],195,false,[false],195,false,[],false,false,[66]]],[[8,[[0,1056,0,0,0,0,0,64,0,0,0,0]],[[0,1024,3584,0,0,0,0,64,240,0,0,0]],196,false,[false],196,false,[],false,false,[1120]],[8,[[0,64,0,0,0,0,0,1056,0,0,0,0]],[[0,64,240,0,0,0,0,1024,3584,0,0,0]],196,false,[false],196,false,[],false,false,[1120]]],[[2,[[0,0,0,0,0,0,0,64,0,0,0,0]],[[0,128,240,0,0,0,0,0,0,0,0,0]],197,false,[false],197,false,[],false,false,[64]]],[[8,[[0,2080,0,0,0,0,0,128,0,0,0,0]],[[0,0,0,0,0,0,0,2304,3840,0,0,0]],198,false,[false],198,false,[],false,false,[2208]],[8,[[0,128,0,0,0,0,0,2080,0,0,0,0]],[[0,2304,3840,0,0,0,0,0,0,0,0,0]],198,false,[false],198,false,[],false,false,[2208]]],[[2,[[0,2080,0,0,0,0]],[[0,0,0,0,0,0]],201,false,[false],201,false,[],false,false,[2080]]],[[8,[[0,2048,0,0,0,0,16777216,5120,32,32505856,0,0]],[[0,2064,3824,0,0,0,16777216,5120,32256,32505856,0,0]],204,false,[false],204,false,[],false,false,[7168]]],[[8,[[16777216,9216,32,32505856,0,0,0,2048,0,0,0,0]],[[16777216,9216,32256,32505856,0,0,0,2064,3824,0,0,0]],205,false,[false],205,false,[],false,false,[11264]]],[[2,[[0,2048,0,0,0,0,0,2064,0,0,0,0]],[[0,2048,3584,0,0,0,0,2048,3584,0,0,0]],206,false,[false],206,false,[],false,false,[2064]],[2,[[0,512,0,0,0,0,0,2064,0,0,0,0]],[[0,512,3584,0,0,0,0,2048,3584,0,0,0]],206,false,[false],206,false,[],false,false,[2576]]],[[8,[[0,2064,0,0,0,0,16777216,1024,0,32505856,0,0]],[[0,0,0,0,0,0,16777216,1056,3824,32505856,0,0]],207,false,[false],207,false,[],false,false,[3088]],[8,[[16777216,1024,0,32505856,0,0,0,2064,0,0,0,0]],[[16777216,1056,3824,32505856,0,0,0,0,0,0,0,0]],207,false,[false],207,false,[],false,false,[3088]]],[[2,[[0,1024,28672,0,0,0]],[[0,17408,32256,0,0,0]],218,false,[false],218,false,[],false,false,[1024]]],[[2,[[0,0,2560,0,0,0,1048576,5120,0,32505856,0,0]],[[0,0,0,0,0,0,34603008,5120,32256,1072693248,0,0]],219,false,[false],219,false,[],false,false,[5120]],[2,[[0,0,2560,0,0,0,1048576,9216,0,32505856,0,0]],[[0,0,0,0,0,0,34603008,9216,32256,1072693248,0,0]],219,false,[false],219,false,[],false,false,[9216]],[2,[[0,0,2560,0,0,0,1048576,17408,0,32505856,0,0]],[[0,0,0,0,0,0,34603008,17408,32256,1072693248,0,0]],219,false,[false],219,false,[],false,false,[17408]],[2,[[2097152,5120,0,32505856,0,0,0,0,2560,0,0,0]],[[69206016,5120,32256,1072693248,0,0,0,0,0,0,0,0]],219,false,[false],219,false,[],false,false,[5120]],[2,[[2097152,9216,0,32505856,0,0,0,0,2560,0,0,0]],[[69206016,9216,32256,1072693248,0,0,0,0,0,0,0,0]],219,false,[false],219,false,[],false,false,[9216]],[2,[[2097152,17408,0,32505856,0,0,0,0,2560,0,0,0]],[[69206016,17408,32256,1072693248,0,0,0,0,0,0,0,0]],219,false,[false],219,false,[],false,false,[17408]],[8,[[0,0,2560,0,0,0,4194304,5120,0,32505856,0,0]],[[0,0,0,0,0,0,138412032,5120,32256,1072693248,0,0]],219,false,[false],219,false,[],false,false,[5120]],[8,[[0,0,2560,0,0,0,4194304,9216,0,32505856,0,0]],[[0,0,0,0,0,0,138412032,9216,32256,1072693248,0,0]],219,false,[false],219,false,[],false,false,[9216]],[8,[[0,0,2560,0,0,0,4194304,17408,0,32505856,0,0]],[[0,0,0,0,0,0,138412032,17408,32256,1072693248,0,0]],219,false,[false],219,false,[],false,false,[17408]],[8,[[8388608,5120,0,32505856,0,0,0,0,2560,0,0,0]],[[276824064,5120,32256,1072693248,0,0,0,0,0,0,0,0]],219,false,[false],219,false,[],false,false,[5120]],[8,[[8388608,9216,0,32505856,0,0,0,0,2560,0,0,0]],[[276824064,9216,32256,1072693248,0,0,0,0,0,0,0,0]],219,false,[false],219,false,[],false,false,[9216]],[8,[[8388608,17408,0,32505856,0,0,0,0,2560,0,0,0]],[[276824064,17408,32256,1072693248,0,0,0,0,0,0,0,0]],219,false,[false],219,false,[],false,false,[17408]]],[[2,[[0,512,0,0,0,0,4194304,1024,0,32505856,0,0]],[[0,512,3584,0,0,0,4194304,1032,3598,32505856,0,0]],226,false,[false],226,false,[],false,false,[1536]],[2,[[0,512,0,0,0,0,8388608,1024,0,32505856,0,0]],[[0,512,3584,0,0,0,8388608,1032,3598,32505856,0,0]],226,false,[false],226,false,[],false,false,[1536]]],[[2,[[0,512,0,0,0,0,0,0,0,0,0,0,4194304,1056,0,32505856,0,0]],[[0,512,3584,0,0,0,0,0,0,0,0,0,4194304,1064,3838,32505856,0,0]],227,false,[false],227,false,[],false,false,[1568]],[2,[[0,512,0,0,0,0,0,0,0,0,0,0,8388608,1056,0,32505856,0,0]],[[0,512,3584,0,0,0,0,0,0,0,0,0,8388608,1064,3838,32505856,0,0]],227,false,[false],227,false,[],false,false,[1568]]],[[8,[[0,2048,0,0,0,0,1048576,5152,8,32505856,0,0]],[[0,6180,32510,0,0,0,0,0,0,0,0,0]],230,false,[false],230,false,[],false,false,[7200]],[8,[[0,512,0,0,0,0,1048576,5152,8,32505856,0,0]],[[0,4644,32510,0,0,0,0,0,0,0,0,0]],230,false,[false],230,false,[],false,false,[5664]]],[[2,[[0,2048,0,0,0,0,0,6180,0,0,0,0]],[[]],231,false,[false],231,false,[["cancel"]],true,false,[6180]],[2,[[0,2048,0,0,0,0,0,4644,0,0,0,0]],[[]],231,false,[false],231,false,[["cancel"]],true,false,[6692]],[2,[[0,512,0,0,0,0,0,6180,0,0,0,0]],[[]],231,false,[false],231,false,[["cancel"]],true,false,[6692]],[2,[[0,512,0,0,0,0,0,4644,0,0,0,0]],[[]],231,false,[false],231,false,[["cancel"]],true,false,[4644]]],[[2,[[0,0,2560,0,0,0,0,6180,0,0,0,0]],[[0,5152,32496,0,0,0,0,2048,3584,0,0,0]],232,false,[false],232,false,[],false,false,[6180]],[2,[[0,0,2560,0,0,0,0,4644,0,0,0,0]],[[0,5152,32496,0,0,0,0,512,3584,0,0,0]],232,false,[false],232,false,[],false,false,[4644]]],[[8,[[0,6180,0,0,0,0,0,0,2560,0,0,0]],[[0,2048,3584,0,0,0,0,5152,32496,0,0,0]],233,false,[false],233,false,[],false,false,[6180]],[8,[[0,4644,0,0,0,0,0,0,2560,0,0,0]],[[0,512,3584,0,0,0,0,5152,32496,0,0,0]],233,false,[false],233,false,[],false,false,[4644]]],[[8,[[0,2048,0,0,0,0,1048576,5120,8,32505856,0,0]],[[0,6148,32270,0,0,0,0,0,0,0,0,0]],236,false,[false],236,false,[],false,false,[7168]],[8,[[0,512,0,0,0,0,1048576,5120,8,32505856,0,0]],[[0,4612,32270,0,0,0,0,0,0,0,0,0]],236,false,[false],236,false,[],false,false,[5632]]],[[2,[[0,2048,0,0,0,0,0,6148,0,0,0,0]],[[]],237,false,[false],237,false,[["cancel"]],true,false,[6148]],[2,[[0,2048,0,0,0,0,0,4612,0,0,0,0]],[[]],237,false,[false],237,false,[["cancel"]],true,false,[6660]],[2,[[0,512,0,0,0,0,0,6148,0,0,0,0]],[[]],237,false,[false],237,false,[["cancel"]],true,false,[6660]],[2,[[0,512,0,0,0,0,0,4612,0,0,0,0]],[[]],237,false,[false],237,false,[["cancel"]],true,false,[4612]]],[[2,[[0,0,2560,0,0,0,0,6148,0,0,0,0]],[[0,5120,32256,0,0,0,0,2048,3584,0,0,0]],238,false,[false],238,false,[],false,false,[6148]],[2,[[0,0,2560,0,0,0,0,4612,0,0,0,0]],[[0,5120,32256,0,0,0,0,512,3584,0,0,0]],238,false,[false],238,false,[],false,false,[4612]]],[[8,[[0,6148,0,0,0,0,0,0,2560,0,0,0]],[[0,2048,3584,0,0,0,0,5120,32256,0,0,0]],239,false,[false],239,false,[],false,false,[6148]],[8,[[0,4612,0,0,0,0,0,0,2560,0,0,0]],[[0,512,3584,0,0,0,0,5120,32256,0,0,0]],239,false,[false],239,false,[],false,false,[4612]]],[[8,[[1048576,9248,8,32505856,0,0,0,2048,0,0,0,0]],[[0,0,0,0,0,0,0,10276,32510,0,0,0]],242,false,[false],242,false,[],false,false,[11296]],[8,[[1048576,9248,8,32505856,0,0,0,512,0,0,0,0]],[[0,0,0,0,0,0,0,8740,32510,0,0,0]],242,false,[false],242,false,[],false,false,[9760]]],[[2,[[0,2048,0,0,0,0,0,10276,0,0,0,0]],[[]],243,false,[false],243,false,[["cancel"]],true,false,[10276]],[2,[[0,2048,0,0,0,0,0,8740,0,0,0,0]],[[]],243,false,[false],243,false,[["cancel"]],true,false,[10788]],[2,[[0,512,0,0,0,0,0,10276,0,0,0,0]],[[]],243,false,[false],243,false,[["cancel"]],true,false,[10788]],[2,[[0,512,0,0,0,0,0,8740,0,0,0,0]],[[]],243,false,[false],243,false,[["cancel"]],true,false,[8740]]],[[2,[[0,0,2560,0,0,0,0,10276,0,0,0,0]],[[0,9248,32496,0,0,0,0,2048,3584,0,0,0]],244,false,[false],244,false,[],false,false,[10276]],[2,[[0,0,2560,0,0,0,0,8740,0,0,0,0]],[[0,9248,32496,0,0,0,0,512,3584,0,0,0]],244,false,[false],244,false,[],false,false,[8740]]],[[8,[[0,0,2560,0,0,0,0,10276,0,0,0,0]],[[0,9248,32496,0,0,0,0,2048,3584,0,0,0]],245,false,[false],245,false,[],false,false,[10276]],[8,[[0,0,2560,0,0,0,0,8740,0,0,0,0]],[[0,9248,32496,0,0,0,0,512,3584,0,0,0]],245,false,[false],245,false,[],false,false,[8740]]],[[8,[[1048576,9216,8,32505856,0,0,0,2048,0,0,0,0]],[[0,0,0,0,0,0,0,10244,32270,0,0,0]],248,false,[false],248,false,[],false,false,[11264]],[8,[[1048576,9216,8,32505856,0,0,0,512,0,0,0,0]],[[0,0,0,0,0,0,0,8708,32270,0,0,0]],248,false,[false],248,false,[],false,false,[9728]]],[[2,[[0,2048,0,0,0,0,0,10244,0,0,0,0]],[[]],249,false,[false],249,false,[["cancel"]],true,false,[10244]],[2,[[0,2048,0,0,0,0,0,8708,0,0,0,0]],[[]],249,false,[false],249,false,[["cancel"]],true,false,[10756]],[2,[[0,512,0,0,0,0,0,10244,0,0,0,0]],[[]],249,false,[false],249,false,[["cancel"]],true,false,[10756]],[2,[[0,512,0,0,0,0,0,8708,0,0,0,0]],[[]],249,false,[false],249,false,[["cancel"]],true,false,[8708]]],[[2,[[0,0,2560,0,0,0,0,10244,0,0,0,0]],[[0,9216,32256,0,0,0,0,2048,3584,0,0,0]],250,false,[false],250,false,[],false,false,[10244]],[2,[[0,0,2560,0,0,0,0,8708,0,0,0,0]],[[0,9216,32256,0,0,0,0,512,3584,0,0,0]],250,false,[false],250,false,[],false,false,[8708]]],[[8,[[0,0,2560,0,0,0,0,10244,0,0,0,0]],[[0,9216,32256,0,0,0,0,2048,3584,0,0,0]],251,false,[false],251,false,[],false,false,[10244]],[8,[[0,0,2560,0,0,0,0,8708,0,0,0,0]],[[0,9216,32256,0,0,0,0,512,3584,0,0,0]],251,false,[false],251,false,[],false,false,[8708]]],[[2,[[0,8,0,0,0,0]],[[0,0,8,0,0,0]],254,false,[false],254,false,[],false,false,[8]]],[[2,[[1048576,1024,0,32505856,0,0]],[[]],257,false,[false],257,false,[["cancel"]],true,false,[1024]]],[[8,[[4194304,1024,0,32505856,0,0]],[[4325376,1280,3840,33521664,0,0]],265,false,[false],265,false,[],false,false,[1024]],[8,[[8388608,1024,0,32505856,0,0]],[[8650752,1280,3840,33521664,0,0]],265,false,[false],265,false,[],false,false,[1024]]],[[2,[[4194304,1024,0,32505856,0,0]],[[4194304,5120,32256,32505856,0,0]],282,false,[false],282,false,[],false,false,[1024]]],[[2,[[8388608,1024,0,32505856,0,0]],[[8388608,9216,32256,32505856,0,0]],283,false,[false],283,false,[],false,false,[1024]]]],"winconditions":[[0,1024,2,291]],"metadata":{"title":"block dude","author":"hayden schiff","homepage":"oxguy3.github.io","again_interval":"0.1"},"levels":[{"message":"Level 1"},{"lineNumber":318,"w":20,"h":6,"layerCount":6,"dat":[513,513,513,513,513,513,1,1,1,1,3,513,1,1,1,1,1,513,1,1,1,1,1,513,1,1,1,513,513,513,1,1,1,1,1,513,1,1,1,1,1,513,1,1,1,1,1,513,1,1,1,1,513,513,1,1,1,1,1,513,1,1,1,1,2049,513,1,1,1,1,1,513,1,1,1,513,513,513,1,1,1,1,1,513,1,1,1,1,2049,513,1,1,1,1,1,513,1,1,1,1,9217,513,1,1,1,1,1,513,1,1,1,1,1,513,513,513,513,513,513,513]},{"message":"Level 2"},{"lineNumber":328,"w":22,"h":10,"layerCount":6,"dat":[1,1,513,513,513,1,1,1,1,1,513,513,513,3,513,513,513,513,1,1,1,1,1,1,1,1,1,513,1,1,1,1,1,1,1,1,1,513,1,1,1,1,1,1,1,1,1,513,1,1,1,1,1,1,1,1,1,513,513,513,513,1,1,1,1,1,1,1,1,513,513,1,1,1,1,1,1,1,1,513,1,1,1,1,1,1,1,1,2049,513,1,1,1,1,1,1,1,513,513,513,1,1,1,1,1,1,1,513,1,1,1,1,1,1,1,1,1,513,1,1,1,1,1,1,1,1,1,513,1,1,1,1,1,1,1,513,513,513,1,1,1,1,1,1,1,1,2049,513,1,1,1,1,1,1,1,1,1,513,1,1,513,1,1,1,1,2049,2049,513,1,1,513,1,1,1,1,1,2049,513,1,1,1,513,1,1,1,1,5121,513,1,1,1,1,513,1,1,1,1,513,1,1,1,1,1,513,1,1,1,513,1,1,1,1,1,1,513,513,513,513,1,1]},{"message":"Level 3"},{"lineNumber":342,"w":19,"h":11,"layerCount":6,"dat":[1,1,513,513,513,513,513,513,513,513,513,513,513,1,1,1,1,1,1,1,3,513,1,1,513,1,1,1,513,513,513,513,513,1,1,1,513,1,1,513,1,1,1,1,1,1,513,1,1,1,513,513,513,513,513,1,513,1,1,1,1,1,1,2049,513,513,1,513,1,1,1,1,1,1,2049,513,1,1,513,1,1,1,1,1,1,1,513,1,1,513,1,1,1,1,1,1,513,513,1,1,513,1,1,1,1,5121,513,513,513,513,1,513,1,1,1,1,1,1,1,1,513,1,513,1,1,1,1,1,1,1,513,513,1,513,1,1,1,1,1,513,513,513,1,1,513,1,1,1,1,513,513,1,1,1,1,513,1,1,1,1,2049,513,1,1,1,1,513,1,1,1,1,1,513,1,1,1,1,513,1,1,1,2049,513,513,1,1,1,1,513,1,1,2049,2049,513,1,1,1,1,1,1,513,513,513,513,1,1,1,1,1]},{"message":"Level 4"},{"lineNumber":357,"w":24,"h":16,"layerCount":6,"dat":[1,1,1,1,1,1,1,1,1,1,513,513,513,1,1,1,1,1,1,1,1,1,513,513,513,513,513,3,513,1,1,1,1,1,1,1,1,513,1,1,1,1,1,1,513,1,1,1,1,1,1,1,513,1,1,1,1,1,1,1,513,1,1,1,1,1,1,1,513,1,1,1,1,1,1,1,513,513,513,513,1,1,1,1,513,1,1,1,1,1,1,1,1,1,1,513,1,1,1,513,1,1,1,1,1,1,513,513,513,513,513,513,1,1,513,1,1,1,1,1,1,1,1,1,1,1,513,1,1,1,1,513,1,1,1,1,1,1,1,2049,2049,2049,513,1,1,1,1,1,513,1,1,1,1,1,1,1,1,1,513,1,1,1,1,1,1,513,1,1,1,1,1,1,1,513,513,1,1,1,1,1,1,1,513,1,1,1,1,1,1,1,513,1,1,1,1,1,1,1,513,1,1,1,1,1,2049,513,513,1,1,1,1,1,1,513,1,1,1,1,1,1,1,2049,513,1,1,1,1,1,513,1,1,1,1,1,1,1,1,1,513,1,1,1,1,513,1,1,1,1,1,1,1,1,513,513,513,1,1,1,513,1,1,1,1,1,1,1,1,1,513,1,1,1,1,513,1,1,1,1,1,1,1,5121,513,513,513,1,1,1,513,1,1,1,1,1,1,1,1,1,1,513,1,1,1,1,1,513,1,1,1,1,1,1,1,1,1,513,1,1,1,1,1,1,513,1,1,1,1,1,1,1,1,513,1,1,1,1,1,1,1,513,1,1,1,1,2049,513,513,513,1,1,1,1,1,1,1,1,513,1,1,2049,2049,513,1,1,1,1,1,1,1,1,1,1,1,513,513,513,513,513,1,1,1,1,1,1]},{"message":"Level 5"},{"lineNumber":377,"w":22,"h":14,"layerCount":6,"dat":[1,1,513,513,513,513,513,513,513,513,1,1,1,1,1,513,1,1,1,1,1,1,3,513,513,513,513,1,1,513,1,1,1,1,1,1,1,1,1,1,513,1,1,513,1,1,1,1,1,1,1,513,513,513,513,1,1,513,1,1,1,1,1,1,1,513,1,1,1,1,513,1,1,1,1,1,1,1,513,513,1,1,1,1,513,1,1,1,1,513,513,513,513,1,1,1,1,1,513,1,1,1,1,1,1,2049,513,1,1,1,1,1,1,513,1,1,1,1,1,2049,513,1,1,1,1,1,1,513,1,1,1,1,1,2049,513,1,1,1,1,1,1,513,1,1,1,1,1,2049,513,1,1,1,1,1,1,513,1,1,1,1,1,1,513,513,1,1,1,1,513,1,1,1,1,1,1,1,5121,513,513,513,513,513,513,1,1,1,1,1,1,1,1,1,1,1,1,513,513,1,1,1,1,1,1,1,1,513,513,513,513,513,513,1,1,1,1,1,1,1,1,1,513,513,513,1,513,1,1,1,1,1,1,1,1,1,1,1,513,1,513,1,1,1,1,1,1,1,1,1,1,1,513,1,513,1,1,1,1,1,1,1,1,1,1,2049,513,1,513,1,1,1,1,1,1,1,1,1,2049,2049,513,1,513,1,1,1,1,1,1,1,1,2049,2049,2049,513,1,1,513,513,513,513,513,513,513,513,513,513,513,513,1]},{"message":"Level 6"},{"lineNumber":395,"w":21,"h":13,"layerCount":6,"dat":[1,1,513,513,513,1,1,1,1,1,1,1,1,513,513,513,3,513,513,513,513,513,513,1,1,1,513,1,1,1,1,1,2049,2049,2049,513,1,1,1,513,1,1,1,1,1,2049,2049,2049,513,1,1,1,1,513,1,1,1,1,1,2049,2049,513,1,1,1,1,513,1,1,1,1,1,1,2049,513,513,513,1,1,513,1,1,1,1,1,1,1,1,1,513,513,1,513,1,1,1,1,1,1,1,1,1,1,513,1,513,1,1,1,1,1,1,1,1,1,513,513,1,513,1,1,1,1,1,1,1,1,2049,513,1,1,513,1,1,1,1,1,1,1,513,513,513,1,1,513,1,1,1,1,1,1,1,513,1,1,1,1,513,1,1,1,1,513,513,513,513,1,1,1,1,513,1,1,1,1,1,5121,513,1,1,1,1,1,513,1,1,1,1,1,2049,513,1,1,1,1,1,513,1,1,1,1,2049,2049,513,1,1,1,1,1,513,1,1,1,1,1,2049,513,513,1,1,1,513,1,1,1,1,1,1,1,1,513,1,1,1,513,1,1,1,1,2049,513,513,513,513,1,1,1,513,1,1,1,1,2049,513,1,1,1,1,1,1,513,513,513,513,513,513,513,1,1,1,1,1,1]},{"message":"Level 7"},{"lineNumber":412,"w":24,"h":14,"layerCount":6,"dat":[1,1,1,1,1,1,513,513,513,1,1,1,1,1,1,513,513,513,513,513,513,3,513,513,513,1,1,1,513,1,1,1,1,1,1,1,1,1,513,513,513,1,1,513,1,1,1,1,1,1,1,1,1,1,513,513,1,1,513,1,1,1,1,1,1,1,1,1,1,513,1,513,513,513,1,1,1,2049,513,513,513,513,513,513,513,1,1,1,1,1,1,1,1,1,1,513,1,1,513,1,1,1,1,1,1,1,2049,2049,2049,513,1,1,513,1,1,1,1,1,1,1,1,1,2049,513,1,1,513,1,1,1,1,1,1,1,1,1,2049,513,1,1,513,1,1,1,1,1,1,1,1,1,1,513,513,1,1,513,1,1,1,1,1,1,1,1,1,1,513,1,1,1,513,1,1,1,1,1,1,513,513,513,513,1,1,513,513,513,1,1,1,1,513,513,513,513,1,1,513,1,1,1,1,1,1,1,1,1,1,513,1,1,513,1,1,1,1,1,1,1,1,2049,2049,513,1,1,1,513,1,1,1,1,1,1,1,1,2049,513,1,1,1,1,513,1,1,1,1,1,1,5121,2049,513,1,1,1,513,513,513,1,1,1,1,513,513,513,513,1,1,513,1,1,1,1,1,1,1,513,513,1,1,1,1,513,1,1,1,1,1,1,1,1,513,1,1,1,1,513,1,1,1,1,1,1,513,513,513,1,1,1,1,1,513,1,1,1,1,1,513,1,1,1,1,1,1,1,1,513,513,513,513,513,513,1,1,1,1,1,1]},{"message":"Level 8"},{"lineNumber":430,"w":27,"h":17,"layerCount":6,"dat":[1,513,513,513,513,513,1,1,1,1,1,513,513,513,513,513,513,513,1,1,2049,2049,513,1,1,1,513,513,1,1,1,1,1,513,513,1,1,1,2049,513,1,513,513,1,1,1,1,1,1,1,513,513,1,1,1,1,513,513,1,1,1,1,1,1,1,1,1,513,1,513,1,1,1,1,513,1,1,1,1,1,1,1,513,1,513,1,1,513,1,1,1,1,1,1,513,1,1,1,2049,513,1,513,1,1,1,513,1,1,1,1,1,513,1,1,1,1,513,1,513,1,1,1,513,1,1,1,2049,2049,513,1,1,1,1,1,1,513,1,1,1,513,1,1,1,1,513,1,513,1,1,1,1,1,513,1,1,513,1,1,1,1,513,1,1,1,513,1,1,1,2049,513,1,513,1,1,1,1,1,1,513,1,513,1,1,1,1,1,513,513,1,1,1,1,513,1,1,1,513,1,1,1,1,1,1,513,513,1,1,1,513,513,1,1,1,1,1,1,1,513,1,1,513,513,1,1,513,513,1,1,1,1,1,1,1,2049,513,1,1,513,513,1,1,1,1,1,1,1,1,1,1,1,1,513,1,1,513,1,513,513,513,1,1,1,1,513,1,1,1,1,1,1,1,513,1,1,513,1,1,1,1,513,1,513,1,1,1,1,1,1,513,1,513,1,1,1,1,513,1,1,1,513,1,1,1,1,1,513,513,1,1,1,1,1,513,1,1,1,513,1,1,1,1,1,513,513,1,1,1,1,1,1,513,513,513,1,1,1,1,1,1,513,513,1,1,1,513,1,1,1,1,1,1,1,1,1,1,5121,513,513,1,1,513,513,1,1,1,1,1,1,513,1,1,1,1,513,513,1,1,513,1,1,1,1,1,1,1,513,1,1,1,1,513,513,1,1,513,513,513,513,1,1,1,1,513,1,1,1,2049,513,513,1,1,1,1,3,513,1,1,1,2049,513,1,1,2049,2049,513,1,513,1,1,1,1,1,1,1,2049,2049,513,1,2049,2049,2049,513,1,1,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513]},{"message":"Level 9"},{"lineNumber":451,"w":20,"h":16,"layerCount":6,"dat":[1,1,1,1,1,1,1,1,513,513,513,1,1,1,1,1,1,1,1,1,1,1,1,513,1,3,513,513,513,513,1,1,1,1,1,1,1,1,513,1,1,1,1,1,1,513,1,1,1,1,1,1,1,513,1,1,1,1,1,1,1,513,513,513,1,1,1,1,513,1,1,1,1,1,1,1,1,1,1,513,1,1,1,513,1,1,1,1,1,1,1,1,1,1,513,513,1,1,513,1,1,1,1,1,1,1,513,513,513,513,513,1,1,513,1,1,1,1,1,1,1,1,513,513,513,1,1,1,513,1,1,1,1,1,1,1,1,1,1,2049,513,1,1,1,513,1,1,1,1,1,1,1,1,1,1,1,513,1,1,1,513,1,1,1,2049,2049,513,1,1,1,1,1,513,1,1,1,1,513,1,1,1,2049,513,1,1,1,513,513,513,1,1,1,1,1,513,1,1,1,513,1,1,1,1,513,513,513,513,1,1,1,1,513,1,1,1,1,1,513,1,1,1,1,513,1,1,1,1,513,1,1,1,5121,2049,513,1,1,1,513,513,1,1,1,513,1,1,1,1,1,1,513,1,1,513,513,1,1,1,1,513,1,1,1,1,513,1,1,1,513,513,1,1,1,1,1,513,1,1,1,2049,513,1,1,1,513,1,1,1,1,1,1,513,1,1,2049,2049,513,1,1,2049,513,1,1,1,1,1,1,513,513,513,513,513,513,513,513,513,513,1,1,1,1]},{"message":"Level 10"},{"lineNumber":471,"w":27,"h":19,"layerCount":6,"dat":[1,1,513,513,513,513,513,513,1,1,1,1,1,1,1,1,1,1,1,1,513,513,1,1,1,3,513,513,513,513,1,1,1,1,1,1,1,1,1,513,513,1,1,1,1,1,1,1,513,1,1,1,1,1,1,1,1,513,1,513,513,1,1,1,1,1,1,513,513,513,513,513,513,513,513,513,513,1,2049,513,513,513,1,1,1,1,513,513,1,1,1,1,2049,2049,513,513,1,1,1,1,513,1,1,1,1,1,513,1,1,1,1,1,2049,513,513,1,1,1,1,1,1,1,1,1,1,513,1,1,1,1,1,1,513,513,1,1,513,513,1,1,1,2049,513,513,513,1,1,1,1,1,1,513,513,1,1,1,513,513,1,1,1,1,513,1,1,1,1,1,1,513,513,513,1,1,1,1,513,513,1,1,1,1,1,1,1,1,1,513,513,1,513,1,1,1,1,2049,513,513,1,1,1,1,1,1,1,1,513,1,1,513,1,1,513,1,2049,513,1,513,1,1,1,1,1,1,1,513,1,1,513,1,2049,513,1,2049,513,1,1,513,1,1,1,1,513,1,513,1,1,513,1,2049,513,1,2049,513,1,513,1,1,1,1,513,513,1,513,1,1,513,513,513,513,1,1,513,513,1,1,1,5121,513,513,1,2049,513,1,1,513,1,2049,513,1,1,513,513,1,1,1,1,1,1,1,1,513,1,1,513,1,1,1,1,1,1,513,513,1,1,1,1,1,1,1,513,1,1,513,1,1,1,513,1,1,1,513,513,1,1,1,1,1,1,513,1,1,513,1,1,1,513,1,1,1,1,513,1,1,1,1,1,1,513,1,1,513,1,1,513,513,1,1,1,1,1,1,1,1,513,1,1,513,513,1,513,1,1,513,1,1,1,1,1,1,1,1,1,513,1,1,1,513,513,513,1,1,513,513,1,1,1,1,1,1,1,1,513,1,1,1,1,513,513,1,1,1,513,1,1,1,1,1,513,1,1,513,1,1,1,2049,513,513,1,1,513,513,1,1,1,1,1,513,1,1,513,1,1,2049,2049,513,1,513,513,513,1,1,1,1,1,1,513,1,1,513,1,2049,2049,2049,513,1,1,513,1,1,1,1,513,1,1,513,1,1,513,513,513,513,513,513,1,1,1,513,513,513,513,513,513,513,513,513,513,513,1,1,1,1,1]},{"message":"Level 11"},{"lineNumber":494,"w":29,"h":19,"layerCount":6,"dat":[513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,1,1,2049,2049,513,1,2049,2049,513,1,1,1,1,513,2049,513,2049,513,513,1,1,1,2049,513,1,1,2049,513,1,1,1,1,513,513,2049,513,513,513,513,1,1,1,1,1,1,1,513,1,1,1,1,513,513,513,2049,513,513,1,1,1,1,1,513,1,1,1,1,2049,1,1,1,1,513,513,513,513,1,1,513,1,2049,513,1,1,2049,1,1,513,1,1,1,513,2049,513,513,1,2049,513,1,2049,513,1,1,1,1,1,513,1,1,1,1,513,513,513,513,513,513,513,513,513,1,1,1,1,1,513,1,1,513,513,513,513,513,1,2049,1,513,1,1,1,1,1,1,1,513,1,1,1,1,1,513,513,1,2049,2049,513,1,1,1,1,513,1,1,513,1,1,1,1,1,513,513,1,1,513,1,1,1,1,513,513,1,2049,513,1,1,1,1,1,513,513,1,1,513,1,1,1,1,513,513,1,2049,513,1,1,1,1,1,513,513,1,1,1,1,1,1,1,513,1,2049,1,513,1,1,513,513,513,513,513,1,1,1,5121,513,1,1,1,1,1,513,513,1,1,1,1,1,513,513,1,1,1,1,1,513,513,513,513,513,1,1,1,1,1,1,1,513,513,1,1,1,1,2049,1,1,1,1,513,1,1,2049,2049,1,1,1,513,513,1,1,1,2049,1,1,513,513,513,513,1,1,1,1,1,2049,1,513,513,1,1,2049,1,1,513,1,2049,513,1,513,1,1,1,1,2049,1,513,513,1,1,1,1,1,513,1,1,2049,1,513,1,1,1,1,2049,1,513,513,1,1,1,1,1,513,1,1,1,2049,513,1,2049,513,1,1,1,513,513,1,1,513,1,1,1,1,1,1,513,513,1,513,1,1,2049,1,513,513,1,1,513,1,1,1,1,1,513,1,1,1,513,1,1,1,2049,513,513,1,513,1,1,1,1,1,513,1,1,1,513,1,1,1,1,2049,513,513,1,513,1,1,1,513,513,1,2049,1,1,513,1,1,513,1,2049,513,513,1,513,3,513,1,513,1,1,1,513,1,513,1,2049,513,1,1,513,513,1,513,1,1,1,513,1,513,513,1,1,513,1,2049,513,1,1,513,513,1,513,513,513,513,1,2049,513,1,1,1,513,513,513,513,1,1,513,513,1,1,1,1,1,1,1,513,1,1,1,1,1,1,1,1,1,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513]}],"idDict":{"0":"background","1":"exit","2":"tryclimbmarker","3":"cantclimbmarker","4":"liftcheckmarker","5":"liftedmarker","6":"trydropmarker","7":"finishdropmarker","8":"fallingmarker","9":"wall","10":"player","11":"box","12":"faceleftmarker","13":"facerightmarker","14":"faceerrormarker"},"objectCount":15,"glyphDict":{"background":[0,-1,-1,-1,-1,-1],"exit":[-1,1,-1,-1,-1,-1],"wall":[-1,-1,-1,-1,9,-1],"player":[-1,-1,-1,-1,10,-1],"box":[-1,-1,-1,-1,11,-1],"tryclimbmarker":[-1,2,-1,-1,-1,-1],"cantclimbmarker":[-1,3,-1,-1,-1,-1],"liftcheckmarker":[-1,-1,4,-1,-1,-1],"liftedmarker":[-1,-1,5,-1,-1,-1],"trydropmarker":[-1,-1,6,-1,-1,-1],"finishdropmarker":[-1,-1,7,-1,-1,-1],"fallingmarker":[-1,-1,-1,8,-1,-1],"faceleftmarker":[-1,-1,-1,-1,-1,12],"facerightmarker":[-1,-1,-1,-1,-1,13],"faceerrormarker":[-1,-1,-1,-1,-1,14],".":[0,-1,-1,-1,-1,-1],"#":[-1,-1,-1,-1,9,-1],"e":[-1,1,-1,-1,-1,-1],"o":[-1,-1,-1,-1,11,-1],"<":[-1,-1,-1,-1,10,12],">":[-1,-1,-1,-1,10,13]},"aggregatesDict":{"<":["player","faceleftmarker"],">":["player","facerightmarker"]},"propertiesDict":{"facemarker":["faceleftmarker","facerightmarker","faceerrormarker"],"gravityobject":["player","box"],"platform":["box","wall"]},"synonymsDict":{".":"background","#":"wall","e":"exit","o":"box"},"backgroundid":0,"backgroundlayer":0,"playerMask":1024,"layerMasks":[1,14,240,256,3584,28672],"objectMasks":[],"lateRules":[[[2,[[0,512,0,0,0,0,0,1056,0,0,0,0]],[[]],210,true,[false],210,false,[["cancel"]],true,false,[1568]]],[[2,[[0,0,512,0,0,0,0,1056,0,0,0,0]],[[0,2080,3824,0,0,0,0,1056,3824,0,0,0]],211,true,[false],211,false,[],false,false,[1056]]],[[2,[[0,2080,0,0,0,0,0,5408,0,0,0,0,0,0,2560,0,0,0]],[[0,0,0,0,0,0,0,2080,3824,0,0,0,0,5408,32752,0,0,0]],267,true,[false],267,false,[],false,false,[7456]],[2,[[0,2080,0,0,0,0,0,9504,0,0,0,0,0,0,2560,0,0,0]],[[0,0,0,0,0,0,0,2080,3824,0,0,0,0,9504,32752,0,0,0]],267,true,[false],267,false,[],false,false,[11552]],[2,[[0,2080,0,0,0,0,0,17696,0,0,0,0,0,0,2560,0,0,0]],[[0,0,0,0,0,0,0,2080,3824,0,0,0,0,17696,32752,0,0,0]],267,true,[false],267,false,[],false,false,[19744]]],[[2,[[0,5376,0,0,0,0,0,0,2560,0,0,0]],[[0,0,0,0,0,0,0,5376,32512,0,0,0]],268,true,[false],268,false,[],false,false,[5376]],[2,[[0,9472,0,0,0,0,0,0,2560,0,0,0]],[[0,0,0,0,0,0,0,9472,32512,0,0,0]],268,true,[false],268,false,[],false,false,[9472]],[2,[[0,17664,0,0,0,0,0,0,2560,0,0,0]],[[0,0,0,0,0,0,0,17664,32512,0,0,0]],268,true,[false],268,false,[],false,false,[17664]]],[[2,[[0,2304,0,0,0,0,0,0,2560,0,0,0]],[[0,0,0,0,0,0,0,2304,3840,0,0,0]],269,true,[false],269,false,[],false,false,[2304]]],[[2,[[0,256,0,0,0,0]],[[0,0,256,0,0,0]],271,true,[false],271,false,[],false,false,[256]]],[[2,[[0,4096,1024,0,0,0]],[[0,0,4096,0,0,0]],284,true,[false],284,false,[],false,false,[4096]],[2,[[0,8192,1024,0,0,0]],[[0,0,8192,0,0,0]],284,true,[false],284,false,[],false,false,[8192]],[2,[[0,16384,1024,0,0,0]],[[0,0,16384,0,0,0]],284,true,[false],284,false,[],false,false,[16384]]]],"rigidGroups":[false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false],"rigidGroupIndex_to_GroupIndex":[],"groupNumber_to_RigidGroupIndex":[],"groupIndex_to_RigidGroupIndex":[],"loopPoint":{"38":39},"lateLoopPoint":{"4":2},"sfx_Events":{"endlevel":"4271703"},"sfx_CreationMasks":[],"sfx_DestructionMasks":[],"sfx_MovementMasks":[],"sfx_MovementFailureMasks":[],"bgcolor":"#000000","fgcolor":"#FFFFFF"};setGameState(loadableGameDat) </script> <div id = "gamecontrols">
<div class = "empty"></div>
<div class = "control up" id = "ctrl_38"></div>
<div class = "empty dragme"></div>
<div class = "control left" id = "ctrl_37"></div>
<div class = "control action" id = "ctrl_88"></div>
<div class = "control right" id = "ctrl_39"></div>
<div class = "control undo" id = "ctrl_90"></div>
<div class = "control down" id = "ctrl_40"></div>
<div class = "control restart" id = "ctrl_82"></div>
<div style = "clear:both"></div>
</div></body> </html>