Click on the example then use WASD (player 1) and the arrow keys (player 2) to collect the coins.
Fully understand the concept by watching the tutorial in full screen at high res.
Once you have watched the video, you can refer to the code below to help you make your own that fits your game. Make sure you type it yourself to help you learn.
To allow player 1 to use WASD and player 2 to use the arrow keys, pay special attention to the code below. The code also shows how to add multiplayer gamepad support.
Make sure you don't use commands like keyboard.UP as they are triggered by both WASD and the arrow keys. Also, be aware that if certain combinations of keys are held down, other keys on the keyboard will temporarily stop working completely. You can test this here. E.g. hold down W, A and D, then press C. C won't register at all. Keep this in mind when making your two-player controls.