Use the WASD keys to move. To aim, use the mouse. To shoot, click.
This is inspired by Asteroids by Atari. This was a program in a Scratch book called Scratch Programming Playground by Al Sweigart, so the credit really goes to him. He also has an account on Scratch, so here it is: @AlSweigart