Skip to content

Instantly share code, notes, and snippets.

@TrevCan
Created July 30, 2020 02:55
Show Gist options
  • Save TrevCan/6544e2400aaff4685b4c28e3c742f431 to your computer and use it in GitHub Desktop.
Save TrevCan/6544e2400aaff4685b4c28e3c742f431 to your computer and use it in GitHub Desktop.
class Player {
Ship s = new Ship(3, 25, 25);
Ship[] ships = new Ship[10];
public Player() {
int c = 0;
int units = 1;
for (int i = 4; i > 0; i--) {
for (int j = i; j > 0; j--) {
if ( c % 2 == 0) {
ships[c] = new Ship(units, 25 + Constants.cellWidth * c, 25);
ships[c].turn(true);
} else {
ships[c] = new Ship(units, 25 + Constants.cellWidth * c, height - 25);
ships[c].setHeading(270);
}
c++;
}
units++;
}
}
public Ship getShip() {
return this.s;
}
public Ship[] getShips() {
return this.ships;
}
}
void keyPressed() {
println("hey there");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment