When I call move() the "y" variable is changed but the box is still rendered in the same position.
var c = document.getElementById("can"); //my canvas id is "can"
var pen = c.getContext("2d");
var y = 200;
setInterval(render(y), 1000/30); //update 30 times per second
function move(dir){
y=y+dir;
}
function render(height) {
pen.beginPath();
pen.clearRect(0,0,888,500);
pen.beginPath();
pen.rect(30,height,50,50); //Draw the player
pen.fillStyle="green";
pen.fill();
}