From 688bcd037a79c1ac6b1884fba148551d128a6fcd Mon Sep 17 00:00:00 2001 From: Leen Dereu Date: Fri, 11 May 2018 12:07:07 +0200 Subject: [PATCH] Projectile --- OGP1718-Worms/src/worms/model/Projectile.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/OGP1718-Worms/src/worms/model/Projectile.java b/OGP1718-Worms/src/worms/model/Projectile.java index 9b1dac7..7f35a7b 100644 --- a/OGP1718-Worms/src/worms/model/Projectile.java +++ b/OGP1718-Worms/src/worms/model/Projectile.java @@ -66,9 +66,20 @@ public abstract class Projectile extends GameObject { public Coordinate getJumpStep(double elapsedTime) { // TODO zie naar worm hoe dit moet, implementatie moet wel anders! + if (Double.isNaN(elapsedTime) || elapsedTime > this.getJumpTime(jumpTimeStep) || elapsedTime < 0) + throw new IllegalArgumentException(); + + double velocity = this.jumpVelocity(); + + + return null; } + public double jumpVelocity() { + return -1; + } + public double getJumpTime(double jumpTimeStep) { // TODO zie naar worm hoe dit moet, implementatie moet wel anders!