This game is inspired by a famous 2D video game: Space Invaders, released by Taito in Japan in 1978 and the US in 1980. It was hugely popular, and helped to launch the commercial video game industry. The object of the game is to move a ship along the bottom of the screen and shoot up at aliens that are descending from the sky, without being hit in return.

1. Demo:


2. Technique:

  1. Building an interactive application in Kotlin.

  2. Using JavaFX to handle drawing and animation of simple graphics.

  3. Providing visual and audial feedback, and gameplay elements to make the game more enjoyable.

3. Features:

  • Homepage: When launched, the title screen will be displayed including:
  1. The title, “Space Invaders”, at the top of the screen.

  2. Instructions on how to play and/or quit your application.

  3. The player should be able to start or quit the game from this screen.

  • Game start: When game starts, it will show:
  1. A game screen, including at least 10 columns and 5 rows of aliens,

  2. A player-controlled ship that can move along the bottom of the screen.

  3. A score indicator.

  4. A level indicator to show which level is in-play.

  1. An indicator of the number of ships remaining.

  2. Status information (current score, level, number of ships) should be visible during gameplay, without obscuring the board.

  • Game start: The alien ships move together as a group. They initially move from their starting position towards the right-side of the screen. When they reach the edge of the screen, the following happens:
  1. The ships all descend one row.

  2. One of the ships fires a missile straight down.

  3. The ships reverse their direction and start moving in the opposite direction.

  4. The ships continue moving until they reach the left-edge of the screen, and the pattern repeats and they start moving right again. They repeat this pattern, descending and alternating directions, until they reach the bottom of the screen or the game ends.

  5. Every time the aliens move, there is a random chance that one of them fires a missle. You should design the rate-of-fire so that there are never more than a few missiles on-screen at a given time.

  6. Every time the player destroys an alien, the remaining aliens speed up. Effectively the game starts out fairly slow, and gets progressively faster as aliens are destroyed.

4. Rules:

  • Lives: The player has three ships at the start of the game.If the player has ships remaining and their ship is destroyed (either by contacting an alien or being struck by a missile), one of the extra ships will be removed If they die for a third time (i.e. they’ve exhausted all ships), then they lose the game.

  • Next: If all of the aliens are destroyed successfully, the next level is launched. Subsequent levels all have the same layout, but the ships and missiles move faster than previous levels, and there may be a slightly higher chance of missiles firing in later levels. The level indicator should clearly indicate the level in play. There does not need to be any other visual changes.

  • Levels: There are three levels, and pressing “1”, “2” or “3” from the start screen will launch the game at that level.

  • Win: If the player succeeds in clearing all three levels, you should show a message telling them that they have won the game and display their final score. You should prompt them to restart or quit the game.

  • Lose: If the player’s ships are all destroyed, you should display a message telling them that they have lost the game, along with their final score. You should prompt them to restart or quit the game.

5. Control:

  • Move: The player interacts with the game by moving the ship left and right to avoid alien ‘A’ moves the ship left, ‘D’ moves the ship right, and SPACE fires missiles.

  • Missiles: The player may fire missiles as often as they wish (with the rate of fire not exceeding 2 missiles per second, and it’s possible for multiple missiles to be in motion). Missiles fly straight up until they strike an alien ship. Missiles will destroy any alien that they strike. Missiles that do not hit an alien disappear when they reach the top of the screen.


View Github