summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichele Bini <michele.bini@gmail.com>2022-04-02 19:18:58 (GMT)
committerMichele Bini <michele.bini@gmail.com>2022-04-02 19:19:20 (GMT)
commit981dd7358c04d0a3d6b305b9f96e398cdcb6937f (patch)
treee5a8d010056de493fac583aa583ff0fb35e36056
parentbc0abcc53c4c4ce24e24037e3d3465e1a2c1924c (diff)
Hopefully improve jump detection and scoring
-rw-r--r--src/displayapp/screens/Motion.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/displayapp/screens/Motion.cpp b/src/displayapp/screens/Motion.cpp
index e667d52..79132ec 100644
--- a/src/displayapp/screens/Motion.cpp
+++ b/src/displayapp/screens/Motion.cpp
@@ -84,11 +84,10 @@ void Motion::Refresh() {
jumping = true;
}
double jump_ratio = 1.0 - G_scaled;
- double jump_ratio *= jump_ratio;
double current_jump_accel = jump_ratio * 9.8;
double current_frame_s = current_frame_ms * 0.001;
current_jump_speed += current_jump_accel * current_frame_s;
- current_jump_length += current_jump_speed * current_frame_s;
+ current_jump_length += current_jump_speed * current_frame_s * jump_ratio;
} else {
if (jumping) {
double best_jump_length = records[0].jump_length;