If you add `return false` at the end of the `keyPressed` function: https://github.com/Code-Bullet/WorldsHardestGameAI/blob/451ed29997ec92203a801c258ea8e3d01eb6cfac/WHG%20-%20level3/sketch.js#L325 That will prevent the page from moving when the user presses space or the arrow keys.