Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

New recompilation step

  • Loading branch information...
commit 6ba33a5f1b29375376ac31a0bf57d379b7feb937 1 parent a95d55a
Rich Daley authored
View
20 public/assets/application-981d1f847369e74ae92ce538727d7bc5.js
20 additions, 0 deletions not shown
View
BIN  public/assets/application-981d1f847369e74ae92ce538727d7bc5.js.gz
Binary file not shown
View
BIN  public/assets/application-fcf2ec53af112896ad1c4d0c32bf554e.css.gz
Binary file not shown
View
BIN  public/assets/application.css.gz
Binary file not shown
View
9 public/assets/application.js
5 additions, 4 deletions not shown
View
BIN  public/assets/application.js.gz
Binary file not shown
View
1  public/assets/fakesnladders-e945b8baec2bffa81924db327ec9b04a.js
@@ -0,0 +1 @@
+function Ladder(e,t){this.fromGrid=e,this.toGrid=t,this.ladderWidth=24,this.ladderStep=16,this.lineWidth=4,this.color="rgb(153, 51, 0)",this.fromGrid.registerAction(this.action())}function Player(e,t,n){this.game=e,this.scoreGrid=t,this.image=n,this.rect=this.scoreGrid.rect}function Grid(e,t,n,r){this.sqNo=e,this.coordinates=t,this.squareSize=n,this.squaresToSide=r,this.position=new Point(this.coordinates.x*this.squareSize,this.coordinates.y*this.squareSize),this.rect=new Rect(this.position.x,this.position.y,this.squareSize,this.squareSize),this.actions=[]}function FakesNLadders(e,t){this.gridSize=t,this.layer=e,this.layer.addGameObject(this),this.squaresToSide=10,this.squareSize=this.gridSize/this.squaresToSide}function init(){function o(){r.drawImage(i,0,0),r.save(),s.draw(r),r.restore(),t.drawImage(n,0,0)}var e=document.getElementById("game"),t=e.getContext("2d"),n=document.getElementById("back-buffer"),r=n.getContext("2d"),i=document.getElementById("background"),s=new Layer;tickManager=new TickManager(o),document.addEventListener("mousedown",function(t){t.stopPropagation();var n=new Point(t.pageX-e.offsetLeft,t.pageY-e.offsetTop);s.hit(n),o()},!1);var u=new FakesNLadders(s,HEIGHT);u.init(o),o()}var tickManager,TICK_INTERVAL=Math.floor(1e3/30),allowClick=!0;Ladder.prototype.action=function(){function t(t){t.moveStraightLine(e.toGrid)}var e=this;return t},Ladder.prototype.drawLadder=function(e,t,n){e.beginPath();var r=t;e.moveTo(r.x+r.width/2-this.ladderWidth/2,r.y+r.height/2),r=n,e.lineTo(r.x+r.width/2-this.ladderWidth/2,r.y+r.height/2),r=t,e.moveTo(r.x+r.width/2+this.ladderWidth/2,r.y+r.height/2),r=n,e.lineTo(r.x+r.width/2+this.ladderWidth/2,r.y+r.height/2);var i=n.x-t.x,s=n.y-t.y,o=Math.sqrt(i*i+s*s),u=this.ladderStep/o,a=(n.x-t.x)*u,f=(n.y-t.y)*u,l=r.x+r.width/2-this.ladderWidth/2,c=r.y+r.height/2,h;for(h=0;h<o-this.ladderStep*2;h+=this.ladderStep)l-=a,c-=f,e.moveTo(l,c),e.lineTo(l+this.ladderWidth,c);e.stroke()},Ladder.prototype.draw=function(e){e.save(),e.lineWidth=this.lineWidth,e.strokeStyle="rgb(70, 70, 70)",this.drawLadder(e,new Rect(this.fromGrid.rect.x,this.fromGrid.rect.y+3,this.fromGrid.rect.width,this.fromGrid.rect.height),new Rect(this.toGrid.rect.x,this.toGrid.rect.y+3,this.toGrid.rect.width,this.toGrid.rect.height)),e.strokeStyle=this.color,this.drawLadder(e,this.fromGrid.rect,this.toGrid.rect),e.restore()},Ladder.prototype.hit=function(e){},Player.prototype.move=function(e){function n(){e.doActions(t)}var t=this;tickManager.addAnimation(new MoveAnimation(this,new Point(e.position.x,e.position.y),.5),n)},Player.prototype.moveStraightLine=function(e){function n(){e.doActions(t)}var t=this;tickManager.addAnimation(new MoveAnimation(this,new Point(e.position.x,e.position.y),.5),n)},Player.prototype.draw=function(e){e.drawImage(this.image,this.rect.x,this.rect.y)},Player.prototype.hit=function(e){this.move(this.game.getGrid(4))},Grid.prototype.draw=function(e){e.save(),e.font="bold 16px sans-serif",e.textBaseline="top",e.textAlign="middle",e.fillText(this.sqNo.toString(),this.position.x+3,this.position.y+3),e.restore()},Grid.prototype.hit=function(e){},Grid.prototype.registerAction=function(e){this.actions.push(e)},Grid.prototype.doActions=function(e){for(var t=0;t<this.actions.length;t++)this.actions[t](e)},FakesNLadders.prototype.init=function(e){var t=0;this.grids=[];for(var n=this.squaresToSide-1;n>=0;n--){for(var r=this.squaresToSide-1;r>=0;r--)this.grids.push(new Grid(t++,new Point(r,n),this.squareSize,this.squaresToSide)),this.layer.addGameObject(this.grids[this.grids.length-1]);n--;for(var r=0;r<this.squaresToSide;r++)this.grids.push(new Grid(t++,new Point(r,n),this.squareSize,this.squaresToSide)),this.layer.addGameObject(this.grids[this.grids.length-1])}this.layer.addGameObject(new Ladder(this.getGrid(3),this.getGrid(22))),this.layer.addGameObject(new Ladder(this.getGrid(25),this.getGrid(43))),this.layer.addGameObject(new Ladder(this.getGrid(40),this.getGrid(58))),this.layer.addGameObject(new Ladder(this.getGrid(81),this.getGrid(99))),this.layer.addGameObject(new Ladder(this.getGrid(55),this.getGrid(86))),this.layer.addGameObject(new Ladder(this.getGrid(49),this.getGrid(92))),this.layer.addGameObject(new Ladder(this.getGrid(12),this.getGrid(31)));var i=new Image;i.src=testPlayerImage,i.onload=e;var s=new Player(this,this.getGrid(0),i);this.layer.addGameObject(s)},FakesNLadders.prototype.getGrid=function(e){return this.grids[e]},FakesNLadders.prototype.draw=function(e){e.save(),e.fillStyle="black",e.strokeRect(0,0,this.gridSize,this.gridSize),e.beginPath();for(var t=.5;t<this.gridSize;t+=this.squareSize)e.moveTo(t,0),e.lineTo(t,this.gridSize);for(var n=.5;n<this.gridSize;n+=this.squareSize)e.moveTo(0,n),e.lineTo(this.gridSize,n);e.strokeStyle="rgba(70, 70, 70, 1)",e.lineWidth=1,e.stroke(),e.restore()},FakesNLadders.prototype.hit=function(e){},window.onload=init;
View
BIN  public/assets/fakesnladders-e945b8baec2bffa81924db327ec9b04a.js.gz
Binary file not shown
View
2  public/assets/fakesnladders.js
@@ -1 +1 @@
-function init(){var e=document.getElementById("game"),t=e.getContext("2d"),n=document.getElementById("background"),r=HEIGHT;t.drawImage(n,0,0),t.fillStyle="black",t.strokeRect(0,0,r,r);var i=10,s=i*i,o=r/i;for(var u=.5;u<r;u+=o)t.moveTo(u,0),t.lineTo(u,r);for(var a=.5;a<r;a+=o)t.moveTo(0,a),t.lineTo(r,a);t.strokeStyle="rgba(70, 70, 70, 1)",t.stroke(),t.font="bold 16px sans-serif",t.textBaseline="bottom",t.textAlign="middle";var f=0,l=o/2;for(var a=i-1;a>=0;a--){for(var u=i-1;u>=0;u--)t.fillText(f++,u*o+l,a*o+l);a--;for(var u=0;u<i;u++)t.fillText(f++,u*o+l,a*o+l)}t.font="bold 24px sans-serif",t.textBaseline="middle",t.textAlign="middle",t.beginPath(),t.moveTo(r,o*2+.5),t.lineTo(WIDTH,o*2+.5),t.stroke(),t.fillText("END",r-(r-WIDTH)/2,o),t.beginPath(),t.moveTo(r,o*5+.5),t.lineTo(WIDTH,o*5+.5),t.stroke(),t.fillText("Option A",r-(r-WIDTH)/2,o*3.5),t.beginPath(),t.moveTo(r,o*8+.5),t.lineTo(WIDTH,o*8+.5),t.stroke(),t.fillText("Option B",r-(r-WIDTH)/2,o*6.5),t.fillText("Status",r-(r-WIDTH)/2,o*9)}document.addEventListener("load",init,!0);
+function Ladder(e,t){this.fromGrid=e,this.toGrid=t,this.ladderWidth=24,this.ladderStep=16,this.lineWidth=4,this.color="rgb(153, 51, 0)",this.fromGrid.registerAction(this.action())}function Player(e,t,n){this.game=e,this.scoreGrid=t,this.image=n,this.rect=this.scoreGrid.rect}function Grid(e,t,n,r){this.sqNo=e,this.coordinates=t,this.squareSize=n,this.squaresToSide=r,this.position=new Point(this.coordinates.x*this.squareSize,this.coordinates.y*this.squareSize),this.rect=new Rect(this.position.x,this.position.y,this.squareSize,this.squareSize),this.actions=[]}function FakesNLadders(e,t){this.gridSize=t,this.layer=e,this.layer.addGameObject(this),this.squaresToSide=10,this.squareSize=this.gridSize/this.squaresToSide}function init(){function o(){r.drawImage(i,0,0),r.save(),s.draw(r),r.restore(),t.drawImage(n,0,0)}var e=document.getElementById("game"),t=e.getContext("2d"),n=document.getElementById("back-buffer"),r=n.getContext("2d"),i=document.getElementById("background"),s=new Layer;tickManager=new TickManager(o),document.addEventListener("mousedown",function(t){t.stopPropagation();var n=new Point(t.pageX-e.offsetLeft,t.pageY-e.offsetTop);s.hit(n),o()},!1);var u=new FakesNLadders(s,HEIGHT);u.init(o),o()}var tickManager,TICK_INTERVAL=Math.floor(1e3/30),allowClick=!0;Ladder.prototype.action=function(){function t(t){t.moveStraightLine(e.toGrid)}var e=this;return t},Ladder.prototype.drawLadder=function(e,t,n){e.beginPath();var r=t;e.moveTo(r.x+r.width/2-this.ladderWidth/2,r.y+r.height/2),r=n,e.lineTo(r.x+r.width/2-this.ladderWidth/2,r.y+r.height/2),r=t,e.moveTo(r.x+r.width/2+this.ladderWidth/2,r.y+r.height/2),r=n,e.lineTo(r.x+r.width/2+this.ladderWidth/2,r.y+r.height/2);var i=n.x-t.x,s=n.y-t.y,o=Math.sqrt(i*i+s*s),u=this.ladderStep/o,a=(n.x-t.x)*u,f=(n.y-t.y)*u,l=r.x+r.width/2-this.ladderWidth/2,c=r.y+r.height/2,h;for(h=0;h<o-this.ladderStep*2;h+=this.ladderStep)l-=a,c-=f,e.moveTo(l,c),e.lineTo(l+this.ladderWidth,c);e.stroke()},Ladder.prototype.draw=function(e){e.save(),e.lineWidth=this.lineWidth,e.strokeStyle="rgb(70, 70, 70)",this.drawLadder(e,new Rect(this.fromGrid.rect.x,this.fromGrid.rect.y+3,this.fromGrid.rect.width,this.fromGrid.rect.height),new Rect(this.toGrid.rect.x,this.toGrid.rect.y+3,this.toGrid.rect.width,this.toGrid.rect.height)),e.strokeStyle=this.color,this.drawLadder(e,this.fromGrid.rect,this.toGrid.rect),e.restore()},Ladder.prototype.hit=function(e){},Player.prototype.move=function(e){function n(){e.doActions(t)}var t=this;tickManager.addAnimation(new MoveAnimation(this,new Point(e.position.x,e.position.y),.5),n)},Player.prototype.moveStraightLine=function(e){function n(){e.doActions(t)}var t=this;tickManager.addAnimation(new MoveAnimation(this,new Point(e.position.x,e.position.y),.5),n)},Player.prototype.draw=function(e){e.drawImage(this.image,this.rect.x,this.rect.y)},Player.prototype.hit=function(e){this.move(this.game.getGrid(4))},Grid.prototype.draw=function(e){e.save(),e.font="bold 16px sans-serif",e.textBaseline="top",e.textAlign="middle",e.fillText(this.sqNo.toString(),this.position.x+3,this.position.y+3),e.restore()},Grid.prototype.hit=function(e){},Grid.prototype.registerAction=function(e){this.actions.push(e)},Grid.prototype.doActions=function(e){for(var t=0;t<this.actions.length;t++)this.actions[t](e)},FakesNLadders.prototype.init=function(e){var t=0;this.grids=[];for(var n=this.squaresToSide-1;n>=0;n--){for(var r=this.squaresToSide-1;r>=0;r--)this.grids.push(new Grid(t++,new Point(r,n),this.squareSize,this.squaresToSide)),this.layer.addGameObject(this.grids[this.grids.length-1]);n--;for(var r=0;r<this.squaresToSide;r++)this.grids.push(new Grid(t++,new Point(r,n),this.squareSize,this.squaresToSide)),this.layer.addGameObject(this.grids[this.grids.length-1])}this.layer.addGameObject(new Ladder(this.getGrid(3),this.getGrid(22))),this.layer.addGameObject(new Ladder(this.getGrid(25),this.getGrid(43))),this.layer.addGameObject(new Ladder(this.getGrid(40),this.getGrid(58))),this.layer.addGameObject(new Ladder(this.getGrid(81),this.getGrid(99))),this.layer.addGameObject(new Ladder(this.getGrid(55),this.getGrid(86))),this.layer.addGameObject(new Ladder(this.getGrid(49),this.getGrid(92))),this.layer.addGameObject(new Ladder(this.getGrid(12),this.getGrid(31)));var i=new Image;i.src=testPlayerImage,i.onload=e;var s=new Player(this,this.getGrid(0),i);this.layer.addGameObject(s)},FakesNLadders.prototype.getGrid=function(e){return this.grids[e]},FakesNLadders.prototype.draw=function(e){e.save(),e.fillStyle="black",e.strokeRect(0,0,this.gridSize,this.gridSize),e.beginPath();for(var t=.5;t<this.gridSize;t+=this.squareSize)e.moveTo(t,0),e.lineTo(t,this.gridSize);for(var n=.5;n<this.gridSize;n+=this.squareSize)e.moveTo(0,n),e.lineTo(this.gridSize,n);e.strokeStyle="rgba(70, 70, 70, 1)",e.lineWidth=1,e.stroke(),e.restore()},FakesNLadders.prototype.hit=function(e){},window.onload=init;
View
BIN  public/assets/fakesnladders.js.gz
Binary file not shown
View
4 public/assets/manifest.yml
@@ -1,6 +1,6 @@
---
-application.js: application-aa46066759dc13e68f250a8c251f3bb7.js
-fakesnladders.js: fakesnladders-791f5e41df987acb81b44755a88aeb72.js
+application.js: application-981d1f847369e74ae92ce538727d7bc5.js
+fakesnladders.js: fakesnladders-e945b8baec2bffa81924db327ec9b04a.js
application.css: application-fcf2ec53af112896ad1c4d0c32bf554e.css
fontawesome-webfont.eot: fontawesome-webfont-7cf1b0de49e2f8672c9ad6d9e382115f.eot
fontawesome-webfont.svg: fontawesome-webfont-4d19fdd70a080778557b652cb4868557.svg
Please sign in to comment.
Something went wrong with that request. Please try again.