That is the way that the square game was programmed to run.
The keyboard control is all in the SquareGame.run() method. You can experiment with modifying the Square game to learn more about Jack programming.
For instance comment out this line and the square will only move while a key is down.
while (~exit) {
// waits for a key to be pressed.
while (key = 0) {
let key = Keyboard.keyPressed();
// do moveSquare();
}
After making that change, try this:
Holding down 'z' and 'x' (grow and shrink) causes the square to also move as it grows and shrinks.
Can you fix the code so that it only moves the square when an arrow key is down?
--Mark