diff --git a/assets/config.json b/assets/config.json index dacc60d..28f6d7b 100644 --- a/assets/config.json +++ b/assets/config.json @@ -13,8 +13,5 @@ "enabled": true, "deadzone": 0.5, "buffer": true - }, - "appearance": { - "grid": "none" } } diff --git a/assets/metaConfig.json b/assets/metaConfig.json index 687d1de..952cb2f 100644 --- a/assets/metaConfig.json +++ b/assets/metaConfig.json @@ -15,12 +15,5 @@ "min": 0, "max": 1 } - }, - "appearance": { - "grid": [ - "grid", - "checkerboard", - "none" - ] } } diff --git a/src/js/input.js b/src/js/input.js index f1fc3b5..cc3dbd8 100644 --- a/src/js/input.js +++ b/src/js/input.js @@ -13,7 +13,6 @@ const handleAngleMagnitude=(x, y, threshold=0, fn=null, clearBuffer=false) => { const {angle, magnitude}=toAngleMagnitude(x, y); if(magnitude>threshold) { - let inputs=currentInputs; if(angle>.25 && angle <.75) inputs.right=true; else if(angle>.75 && angle<1.25) inputs.up=true; else if(angle>1.25 && angle<1.75) inputs.left=true; @@ -70,7 +69,7 @@ const handleJoystick=(() => { !config.touchscreen.buffer ) } -})(); +}); const handleSwipe=(() => { let center={ @@ -92,7 +91,7 @@ const handleSwipe=(() => { !config.touchscreen.buffer ) } -})(); +}); const handleGamepads={ frame: () => { @@ -112,7 +111,6 @@ const handleGamepads={ const handleEvent=(type, evt) => { for(let handler of handlers) { - console.log(type, handler); let fn=handler[type]; if(fn) fn(evt); } diff --git a/src/js/main.js b/src/js/main.js index 7c35f2c..a914b9b 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -102,7 +102,7 @@ const rules=levelList[category].rules || {}; const level=await levels.get(filename); - // create the game and attach the callbacks and config + // create the game and attach the callbacks const snek=currentGame=new SnekGame(level, canvas, rules); snek.callback=evt => { if(evt=='tick') { @@ -114,7 +114,6 @@ handleDeath(snek); } }; - snek.config=config; // setup the DOM nav.classList.add('hidden'); diff --git a/src/js/snek.js b/src/js/snek.js index 586d028..60c0117 100644 --- a/src/js/snek.js +++ b/src/js/snek.js @@ -104,7 +104,6 @@ class SnekGame { draw() { const assets=require('assets'); - const config=this.config; // clear the canvas, because it's easier than having to deal with everything this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height); @@ -124,31 +123,7 @@ class SnekGame { this.ctx.fillRect(offsetX+cellSize*this.dimensions[0], 0, offsetX, this.canvas.height); this.ctx.fillRect(0, offsetY+cellSize*this.dimensions[1], this.canvas.width, offsetY); - // draw a grid/checkerboard if requested - if(config.appearance.grid=='grid') { - this.ctx.strokeStyle='rgba(0, 0, 0, 50%)'; - this.ctx.lineCap='square'; - this.ctx.lineWidth=1; - this.ctx.beginPath(); - for(let x=1; x