League Invaders Pt.4

Inputs

1. Go to your GamePanel class. We need to add inputs to our game. Implement the KeyListener interface.

public class GamePanel extends JPanel implements ActionListener, KeyListener{  }

2. Add the unimplemented methods.

3. Put a line of code in each added method to print a message to the console.

4. Go to your LeagueInvaders class. Add a KeyListener to your JFrame. Use your GamePanel object to add the Key Listener.

5. Do not continue until you are able to print the message from each listener method.