Is there any reason why I would be getting the error
Uncaught TypeError: inter is not a function at movingPiece (script.js:270) at keyboardMove (script.js:146)
in this code:
var inter = setInterval(function() {
draw();
b_ctx.globalCompositeOperation = "copy";
b_ctx.fillStyle = "purple";
b_ctx.beginPath();
b_ctx.arc(xcoord, y, 45, 0, Math.PI * 2, true);
b_ctx.fill();
y += 1;
if (y > endY) clearInterval(inter)
}, 25);
inter();
setIntervaldoes not return a function?! Just drop theinter();statement and your code should work. Why did you think did you need it, what did you expect it to do?