A character is much more interesting when you can nudge it around.
Try it
Click Play, then hold A / D or the arrow keys. Touch buttons inside the game send the same input. Drag Movement speed and try stopping near an edge. Press Tab to leave the game and reach the lesson controls.
Actions describe intent
The default actions map WASD and arrow keys to directions. You can provide your own named actions when a game needs jump, dash, or something stranger. Each action can have several keys.
game.input.direction().x gives horizontal input between -1 and 1.
game.update receives elapsed seconds for one simulation step, so
direction * speed * dt moves at the chosen logical units per second.
Hopkit commits input once per simulation step.
The clamp keeps the character inside this first room. You will replace it with world bounds and collision in the next chapters.
Make one change
Change speed to 100. Then 300. Which one leaves you enough time to react?