You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
883 B

2 years ago
function keyPressed(){
switch(keyCode){
case 68: //D
debug = !debug;
return false;
case 71: //G
grid = !grid;
return false;
case RIGHT_ARROW:
if (state < 16) state++;
break;
case LEFT_ARROW:
if (state > 0) state--;
break;
}
updater();
}
function keyReleased(){
switch(keyCode){
}
}
function mouseDragged(){
}
function mousePressed(){
}
function mouseReleased(){
}
function mouseWheel(event){
scale -= event.delta > 0 ? scale / 50 : -scale / 50;
return false;
}
window.onresize = function(event){
resizeCanvas($("#canvasHolder").width(), $("#canvasHolder").height());
}
function checkKeys(){
if (keyIsDown(UP_ARROW) && !keyIsDown(DOWN_ARROW) && scale < 100) scale += scale / 50;
if (keyIsDown(DOWN_ARROW) && !keyIsDown(UP_ARROW) && scale > 10) scale -= scale / 50;
if (scale < 10) scale = 10;
if (scale > 100) scale = 100;
}