Hello all:
The task is to:
Create a row of Alien attackers, class RowOfAlien, patterned after the partially filled array. Put five Aliens in the row. When the row hits the left or right of the screen, the Aliens snake downwards (see demo). Note that this is different from the video game where the entire row bounces as one unit.
Left and right keys move the canon. The canon fires automatically (as in version 1) but the bullet is fired from the current position of the canon.Note that you must press space bar a couple of times to get keyboard interaction working.
To make it easier to debug your program, print a message in the console when each of the following happens:
* An alien is hit by a bullet
* The left or right keys are pressed
3) Modify GameDemo to:
* Play the game multiple times.
* Display the outcome of each game.
* At the conclusion of play, show the total number of games won and lost
So far I have this small chunk of code
public class RowOfAlien {
// CONSTANTS
public final int EMPTY = -1;
// VARIABLES
private Alien[] row;
private int topIndex;
public RowOfAlien(int numberOfAliens) {
row = new Alien[numberOfAliens];
topIndex = EMPTY;
}
public void add( Alien alien ) {
// Put your code here
}
public void draw(Graphics g) {
// Put your code here
}
public void move() {
// Put your code here
}
public void remove(int index) {
// Put your code here
}
}
But its saying that there is already an error on the line that contains public RowofAliens
Any suggestions to help me start?