Unverified Commit 6d3ffb15 authored by Ragnat0skr's avatar Ragnat0skr Committed by GitHub

Add files via upload

parent 4a54f26d
This diff is collapsed.
import javafx.scene.shape.Rectangle;
public class Sea extends Rectangle{
int x; // Each sea tile has 2 main propeties, x and y placements
int y; // Other propeties will be determined in main using javafx
public Sea(){
}
}
public class Ships extends Main{
public int shipType; // Set up variables
public int shipHp;
public boolean shipIsVertical = true; // True for vertical, false for horizontal
// SHIP TYPES
// 1 does not exist
// 2 = Patrol boat, size 2
// 3 = Destroyer, size 3
// 4 = Battleship, size 4
// 5 = Aircraft carrier, size 5
//boolean shipIsVertical = true;
public Ships(int shipType, boolean shipIsVertical)
{
this.shipType = shipType; // Sets unique variable for each ship
this.shipIsVertical = shipIsVertical;
shipHp = shipType; // Hp based on type
}
public void shipIsHit()
{
int shipHp = shipType;
shipHp = shipHp - 1;
}
public boolean shipIsNotSunk() // Changed from shipSunk
{
return shipHp >= 0; // Fires if ship Hp reaches 0 (or below somehow)
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment