A simple Spaceship java game

  • Posted:
  • Proposals: 0
  • Remote
  • #38442
  • Archived
  • 0

Description

Experience Level: Intermediate
Need to create a simple Spaceship game with one player and three enemy ships. The player's ship can move left and right and can shoot enemy ships. The enemy ships are programmed to repeatedly move left and right. The game finishes when all enemies are destroyed.

The program begins by asking the user to input the initial position and velocity for each enemy ship.
* Initial x position: The left boundary of the coordinate system is at position -6, the right boundary is at position 6, and the middle of the screen is at position 0. Your program does not need to check if the user enters a position out of this range.
* Initial velocity: The user may enter either -1 or 1. Your program does not need to check if the user enters an invalid velocity. A velocity of -1 causes the enemy to move left, while a velocity of 1 causes the enemy to move right.
The player's ship is placed at position 0. Then, the game enters a loop in which the current game state and score is printed to the screen, and the user is asked to enter a move. The move can be one of 3 options:
* l: move the player's ship one space to the left if it would not move out of bounds.
* r: move the player's ship one space to the right if it would not move out of bounds.
* f: fire a bullet straight ahead, destroying any and all ships in its path.
Each time a move is performed, the enemies must move before the player's own move happens. The enemy moves by moving left or right (depending on its velocity) until hitting a boundary, and then turning around and heading in the other direction.
Each time an enemy is shot down, 1 point is awarded, plus a bonus of 5-N points if the previous ship was shot down N moves ago (including l/r/f moves) if N 5. Once all enemy ships have been destroyed, the game loop terminates, and the message You won! is printed.

New Proposal

Create an account now and send a proposal now to get this job.

Sign up

Clarification Board Ask a Question

    There are no clarification messages.