If the boots are turned off you should stop the timeout, there's no reason to keep it running every 0.05 seconds (even if it's not doing anything except constantly hiding the images). You can also use
hideimgs(200, 201) to hide a range of images.
Something like this:
PHP Code:
function onKeyPressed(temp.code, temp.key) {
if (temp.key == "z") {
this.on = ! this.on; // better to use booleans instead of integers for clarity
if (this.on) {
this.ShowingImage();
this.trigger("timeOut"); // this.setTimer(0.05) or this.onTimeOut() is also acceptable
} else {
this.HidingImage();
this.setTimer(0);
}
} else if (temp.key == "=") {
// etc
}
}
You might also want to only show the images once (when the boots are turned on), and redraw them only when the screen resizes. You can then do
PHP Code:
findImg(201).text = "Speed: " @ this.speed;
after changing the boot speed.