Phaser: Keyboard Events
This blog post is part of a series on Phaser. If you haven’t read the first post yet, you can find it here. Unlike mouse events, which are fired on a GameObject, keyboard events are not directly linked to any specific GameObject. Instead, we listen for keyboard events on the this.input.keyboard object. To listen for keyboard events, we can use the following syntax: this.input.keyboard.on(<event>, function() { // event handler code }) The <event> parameter is a string that can be either keydown or keyup, which allows us to intercept all keys being pressed or released....