Created
July 30, 2020 02:55
-
-
Save TrevCan/6544e2400aaff4685b4c28e3c742f431 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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