Projectile: fix errors
This commit is contained in:
@@ -129,7 +129,6 @@ public abstract class Projectile extends GameObject {
|
||||
Coordinate newLocation;
|
||||
|
||||
|
||||
//TODO extra parameter if: als de worm die wil schieten tegen een andere worm staat:
|
||||
//TODO In case the initial position of a projectile already hits impassable terrain or a worm, the projectile will
|
||||
//TODO jump over a distance of 0.0 m.
|
||||
if (getWorld().isAdjacent(getLocation(),getRadius())) {
|
||||
@@ -153,7 +152,6 @@ public abstract class Projectile extends GameObject {
|
||||
wormLocation.getY() + sin(wormOrientation) * (wormRadius + radius));
|
||||
}
|
||||
|
||||
//TODO hit impassable terrain (adjacent, partly or complete): projectile stays at that position
|
||||
public void hit(Worm... worm){
|
||||
for (Worm wormA : worm){
|
||||
//TODO bazooka: hitpoints multiplied with force?
|
||||
|
@@ -1222,8 +1222,8 @@ public class Worm extends GameObject {
|
||||
List<Projectile> projectiles = getWorld().getGameObjectsByClass(Projectile.class);
|
||||
for (Projectile project: projectiles) {
|
||||
if (this.getDistance(project) <= 0) {
|
||||
project.hit(this);
|
||||
return null;
|
||||
project.hit(this);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user