Unnamed Fossil Project

Check-in [e97605d164]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:added resetting playmode to reset function
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:e97605d164e68a822d93b8f1ecad727822852b6d
User & Date: Derek 2013-02-27 21:36:58
Context
2013-02-27
22:25
fixed a problem with a string getting stored in the width instead of a float bad dimensions in reset fail earlier Leaf check-in: 58704e8a71 user: Derek tags: trunk
21:36
added resetting playmode to reset function check-in: e97605d164 user: Derek tags: trunk
21:31
fixed stuff with the file functions. check-in: ff55e2623b user: Derek tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to maze.html.

125
126
127
128
129
130
131


132
133
134
135
136
137
138
...
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
if(w+h>maxdimsum)return 0;
w=width,h=height;
pxsize=Math.max(Math.floor(maxpxdimsum/(w+h)),1);
goalx=w-1,goaly=h-1,startx=0,starty=0,
arr=new Array(w*h);
for(var i=0;i<w*h;++i)arr[i]=0;
x=0.5,y=0.5,dx=0,dy=0;


drawmaze();draw();return 1;}

function drawmaze(){//mazecanvas
var w=width,h=height,l=w*h,pxs=pxsize;
if(!mazecanvas)return;mazecanvas.width=pxs*w*2;mazecanvas.height=pxs*h*2;
var mctx=mazecanvas.getContext("2d");
mctx.fillStyle="#fff";mctx.fillRect(0,0,pxs*w,pxs*h);mctx.fillStyle="#000";
................................................................................
var dim=/([0-9]*)[^0-9]*([0-9]*)/.exec(prompt("\nEnter new dimensions\n(Current maze will be cleared):\n"));
reset(dim[1],dim[2]);}}

var _=addbutton;
_("Start","#cfc",function(){x=startx+0.5,y=starty+0.5;victory=false;testonly=false;playmode();});
_("File","#cbf",file);
eb=_("Edit","#fb6",function(){edit?playmode():(editmode(),testonly=true);});
_("Reset","#faa",function(){testonly=false;playmode();reset(5,5);});
_("Help","#acf",function(){alert(helpmsg);});
zi=_("+",0,function(){screenblocks*=0.8;});
zo=_("-",0,function(){screenblocks/=0.8;});
//undo=_("<",0,function(){alert('undo stuff goes here.');}
zi.className+=" bigtxt";zo.className+=" bigtxt";//undo.className+=" bigtxt";
}








>
>







 







<







125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
...
220
221
222
223
224
225
226

227
228
229
230
231
232
233
if(w+h>maxdimsum)return 0;
w=width,h=height;
pxsize=Math.max(Math.floor(maxpxdimsum/(w+h)),1);
goalx=w-1,goaly=h-1,startx=0,starty=0,
arr=new Array(w*h);
for(var i=0;i<w*h;++i)arr[i]=0;
x=0.5,y=0.5,dx=0,dy=0;
testonly=false;
if(playmode)playmode();
drawmaze();draw();return 1;}

function drawmaze(){//mazecanvas
var w=width,h=height,l=w*h,pxs=pxsize;
if(!mazecanvas)return;mazecanvas.width=pxs*w*2;mazecanvas.height=pxs*h*2;
var mctx=mazecanvas.getContext("2d");
mctx.fillStyle="#fff";mctx.fillRect(0,0,pxs*w,pxs*h);mctx.fillStyle="#000";
................................................................................
var dim=/([0-9]*)[^0-9]*([0-9]*)/.exec(prompt("\nEnter new dimensions\n(Current maze will be cleared):\n"));
reset(dim[1],dim[2]);}}

var _=addbutton;
_("Start","#cfc",function(){x=startx+0.5,y=starty+0.5;victory=false;testonly=false;playmode();});
_("File","#cbf",file);
eb=_("Edit","#fb6",function(){edit?playmode():(editmode(),testonly=true);});

_("Help","#acf",function(){alert(helpmsg);});
zi=_("+",0,function(){screenblocks*=0.8;});
zo=_("-",0,function(){screenblocks/=0.8;});
//undo=_("<",0,function(){alert('undo stuff goes here.');}
zi.className+=" bigtxt";zo.className+=" bigtxt";//undo.className+=" bigtxt";
}