Input:
else if (keyCode == KeyEvent.VK_M) {//keyReleased CODE
ironMan.prepareToFly = ironMan.fly = false;
System.out.println("Height before drop: "+ironMan.height);
ironMan.model.getRoot().translate(0, -ironMan.height, 0);
ironMan.height = 0.000f;
}
Logic:
else if (prepareToFly) {
model.animateSkin((frame+=.12f), 5);
model.getRoot().translate(0, (height+=((float)(-8f*deltaTime))), 0);
if (frame >= 1.00f) {
System.out.println("Total height: "+height);
prepareToFly = false;
fly = true;
}
}
else if (fly)
model.animateSkin((frame+=.12f), 2);
Result: ironMan drops far less than he flew up (stays above ground). But the println show identical values for ironMan.height. What gives?