commentaar jumpStep
This commit is contained in:
@@ -662,8 +662,17 @@ public class Worm {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param deltaTime ...
|
* @param deltaTime
|
||||||
* @return Tuple<Double, Double>
|
* the total time the worm schould jump
|
||||||
|
* @return Tuple<Double, Double> with the new location of the worm. The new x-coordinate is the old x-coordinate plus the jump velocity
|
||||||
|
* multiplied with the cosinus of the orientation multiplied with delta time. The new y-coordinate is the old y-coordinate plus
|
||||||
|
* the jump velocity multiplied with the sinus of the orientation multiplied with delta time minus 0,5 times the gravity multiplied
|
||||||
|
* with the second power of delta time
|
||||||
|
* |Tuple.create(getLocation().item1 + this.jumpVelocity() * cos(getOrientation()) * deltaTime,
|
||||||
|
|getLocation().item2 + this.jumpVelocity() * sin(getOrientation()) * deltaTime - 0.5 * G * pow(deltaTime, 2))
|
||||||
|
* @throws IllegalArgumentException()
|
||||||
|
* if the deltaTime is not a number or bigger then jumpTime or smaller then 0
|
||||||
|
* |if (Double.isNaN(deltaTime) || deltaTime > this.jumpTime() || deltaTime < 0)
|
||||||
*/
|
*/
|
||||||
public Tuple<Double, Double> jumpStep(double deltaTime) {
|
public Tuple<Double, Double> jumpStep(double deltaTime) {
|
||||||
if (Double.isNaN(deltaTime) || deltaTime > this.jumpTime() || deltaTime < 0)
|
if (Double.isNaN(deltaTime) || deltaTime > this.jumpTime() || deltaTime < 0)
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
- getMaxActionPoints DONE
|
- getMaxActionPoints DONE
|
||||||
- decreaseActionPoints DONE
|
- decreaseActionPoints DONE
|
||||||
- canTurn DONE
|
- canTurn DONE
|
||||||
- Tuple (methode)
|
- jumpStep DONE
|
||||||
* testen schrijven
|
* testen schrijven
|
||||||
* documentatie Facade
|
* documentatie Facade
|
||||||
* is Facade klaar?
|
* is Facade klaar?
|
||||||
|
Reference in New Issue
Block a user