I recently made a game with phaser and noticed that when I press down key the page goes down. Similarly the same happens with up key. Even space key makes the page scroll down. The game gets the keys and works the way it should work but the page also scrolls. This totally ruins the fun. How to handle this situation???
This problem is totally unrelated to phaser. You only have to stop the the default action from being executed. This is done with event.preventDefault(). You have to add an event listener to the window object. Listen for the keydown event. Check if the key code is one of the codes for top, down, left, right or spacebar. If so stop the default action with event.preventDefault(). If you want real code to copy & paste in your project use google. Have fun!