Assignment 10: Game - Part 1


The game we will be making this semester is Space Invaders. If you have not played the game before you can find an online version here. Take a few minutes to play the game and become familiar with how it works before starting the assignment.

The game will count for two labs. This week you'll design and implement the building blocks of the game. Next week you will write the game logic and tie all of the pieces together.


For part one, you must have the following parts of the game working:

  • You should be able to create multiple aliens that move around the screen. You should be able to show aliens that move horizontally, vertically, and diagonally.

  • You should be able to create one player that can move around by pushing buttons on the keyboard. To help you with this, we have supplied you with an ArcadeKeys class in your repository. To use this class you need to call the ArcadeKeys.isKeyPressed() method, which accepts a player and a key as input parameters. So for example, if you wanted to check if player 1 had pressed the W key, you would do the following:

    ArcadeKeys.isKeyPressed(0, ArcadeKeys.KEY_UP)

    For reference, player 1 is mapped to use the WASD keys, and player 2 is mapped to use the arrow keys.

  • You should be able to detect when the player has collided with an alien, and react accordingly. The player's position should be reset to the original starting point. To make this part easier you may display the player and the alien as simple shapes like circles or squares, however you must somehow distinguish the player from the aliens.

  • You must use at least one interface. If you are confused about what you should be using the interface for, there will be a studio session on November 17th, where we will discuss the overall design of this game.

  • Your code must be reasonably modular. This means that you are not simply hard coding everything into the main method. main should have a few lines of code at most. Similar items should be grouped into lists, arrays, or sets. Variables should have meaningful names. Classes should not rely on assumed information about the environment. The studio on the 17th should help lead you towards a good, modular, design.