Merge branch 'master' of gitlab.principis.be:OGP/worms
This commit is contained in:
5
OGP1718-Worms/src/worms/model/Food.java
Normal file
5
OGP1718-Worms/src/worms/model/Food.java
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
package worms.model;
|
||||||
|
|
||||||
|
public class Food {
|
||||||
|
|
||||||
|
}
|
5
OGP1718-Worms/src/worms/model/Team.java
Normal file
5
OGP1718-Worms/src/worms/model/Team.java
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
package worms.model;
|
||||||
|
|
||||||
|
public class Team {
|
||||||
|
|
||||||
|
}
|
@@ -6,6 +6,8 @@ import worms.util.IllegalNameException;
|
|||||||
|
|
||||||
import static java.lang.Math.*;
|
import static java.lang.Math.*;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A class with the specifications of the worm
|
* A class with the specifications of the worm
|
||||||
*
|
*
|
||||||
@@ -122,6 +124,9 @@ public class Worm {
|
|||||||
if (validName != -1)
|
if (validName != -1)
|
||||||
throw new IllegalNameException(validName, name);
|
throw new IllegalNameException(validName, name);
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
|
||||||
|
long startHitPoints = 1000 + (new Random().nextLong() * (2000 - 1000));
|
||||||
|
setHitPoints(startHitPoints);
|
||||||
}
|
}
|
||||||
|
|
||||||
//===================================================================================
|
//===================================================================================
|
||||||
@@ -655,7 +660,7 @@ public class Worm {
|
|||||||
* let the worm jump
|
* let the worm jump
|
||||||
*
|
*
|
||||||
* @post the worm jumps to his new place. The new place is the x-coordinate plus the jump distance
|
* @post the worm jumps to his new place. The new place is the x-coordinate plus the jump distance
|
||||||
* with the jump velocity
|
* with the jump velocity
|
||||||
* |setLocation(Coordinate.create(getLocation().getCoordinateX() + jumpDistance(this.jumpVelocity()), getLocation().getCoordinateY()))
|
* |setLocation(Coordinate.create(getLocation().getCoordinateX() + jumpDistance(this.jumpVelocity()), getLocation().getCoordinateY()))
|
||||||
* @post the current action actionPoints should be 0 after a jump
|
* @post the current action actionPoints should be 0 after a jump
|
||||||
* |setActionPoints(0)
|
* |setActionPoints(0)
|
||||||
@@ -753,6 +758,26 @@ public class Worm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//===================================================================================
|
||||||
|
// endregion
|
||||||
|
|
||||||
|
// region hitPoints
|
||||||
|
//===================================================================================
|
||||||
|
|
||||||
|
@Basic @Raw
|
||||||
|
public long gethitPoints() {
|
||||||
|
return this.hitPoints;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Raw
|
||||||
|
private void setHitPoints(long hitPoints) {
|
||||||
|
if (hitPoints <= 0)
|
||||||
|
//TODO worm sterft + weghalen van gamewereld
|
||||||
|
this.hitPoints = hitPoints;
|
||||||
|
}
|
||||||
|
|
||||||
|
private long hitPoints;
|
||||||
|
|
||||||
//===================================================================================
|
//===================================================================================
|
||||||
// endregion
|
// endregion
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user