Commit 1710e729 authored by jphoe's avatar jphoe

Hello there

parents
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>BattleshipsExport</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<accessrules>
<accessrule kind="accessible" pattern="**"/>
</accessrules>
</classpathentry>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/JavaFx"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Battleships</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
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