revert: restore original dash length and post-dash slow
This commit is contained in:
1 parent
85238be844
commit
683e7a47ec
3 files changed
+7
-7
No files matched your search
+1
-1
@@ -54,7 +54,7 @@ Your best score is saved in `localStorage` as `meatslicer_best` and shown on the
|
||||
| **T** | Toggle Auto-Draft (auto-pick random perk on level-up) |
|
||||
| **M** | Mute / unmute |
|
||||
| **N** | Next music track |
|
||||
| **Shift** | Dash in the movement direction; 2× length, 0.6s of 30% slow |
|
||||
| **Shift** | Dash in the movement direction; 0.6s of 50% slow after (net 95% of walking distance) |
|
||||
|
||||
### Perk draft screen (level-up)
|
||||
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
// ---- the butcher (player) ----
|
||||
|
||||
const DASH_SLOW_T = 0.6; // seconds of 30% move speed after a dash; doubles as the dash cooldown
|
||||
const DASH_SLOW_T = 0.6; // seconds of 50% move speed after a dash; doubles as the dash cooldown
|
||||
|
||||
function defaultPlayerStats() {
|
||||
return {
|
||||
@@ -86,7 +86,7 @@ function updatePlayer(dt) {
|
||||
const len = Math.hypot(mx, my);
|
||||
const firing = held ? (w.id === 'bonepopper' ? 0.95 : 0.85) : 1;
|
||||
if (keyPressed('shift') && p.dashSlowT <= 0) {
|
||||
const dashD = 0.9 * (178 * st.speedMul * firing) * DASH_SLOW_T;
|
||||
const dashD = 0.45 * (178 * st.speedMul * firing) * DASH_SLOW_T;
|
||||
p.x += (mx / len) * dashD;
|
||||
p.y += (my / len) * dashD;
|
||||
p.dashSlowT = DASH_SLOW_T;
|
||||
@@ -94,7 +94,7 @@ function updatePlayer(dt) {
|
||||
spawnShockwave(p.x, p.y, 26, '#d8c9a8', 0.35);
|
||||
Sfx.duck();
|
||||
}
|
||||
const spd = 178 * st.speedMul * firing * (p.dashSlowT > 0 ? 0.3 : 1);
|
||||
const spd = 178 * st.speedMul * firing * (p.dashSlowT > 0 ? 0.5 : 1);
|
||||
p.x += (mx / len) * spd * dt;
|
||||
p.y += (my / len) * spd * dt;
|
||||
p.step += dt * 9 * Math.min(st.speedMul, 1.8);
|
||||
|
||||
+3
-3
@@ -1200,7 +1200,7 @@ console.log('== dash: burst, slow, cooldown ==');
|
||||
release('shift');
|
||||
const dashDx = p.x - xBeforeDash;
|
||||
check('dashSlowT > 0 after dash', p.dashSlowT > 0);
|
||||
check('dash burst within 5% of 0.9*178*0.6', Math.abs(dashDx - 0.9*178*0.6) <= 0.05 * 0.9*178*0.6);
|
||||
check('dash burst within 5% of 0.45*178*0.6', Math.abs(dashDx - 0.45*178*0.6) <= 0.05 * 0.45*178*0.6);
|
||||
let slowDist = 0;
|
||||
let slowFrames = 0;
|
||||
let sampledSlowDx = 0;
|
||||
@@ -1225,8 +1225,8 @@ console.log('== dash: burst, slow, cooldown ==');
|
||||
slowFrames++;
|
||||
}
|
||||
}
|
||||
check('slow per-frame dx is roughly 30% of baseline', sampledSlowDx > 0 && sampledSlowDx >= 0.25 * baselineDx && sampledSlowDx <= 0.35 * baselineDx);
|
||||
check('total dash (burst + slow) within 8% of 1.2*178*0.6', Math.abs((dashDx + slowDist) - 1.2*178*0.6) <= 0.08 * 1.2*178*0.6);
|
||||
check('slow per-frame dx is roughly half baseline', sampledSlowDx > 0 && sampledSlowDx >= 0.4 * baselineDx && sampledSlowDx <= 0.6 * baselineDx);
|
||||
check('total dash (burst + slow) within 8% of 0.95*178*0.6', Math.abs((dashDx + slowDist) - 0.95*178*0.6) <= 0.08 * 0.95*178*0.6);
|
||||
ctx.Input.keys.d = false;
|
||||
step(3, 16);
|
||||
const xBeforeIdle = p.x;
|
||||
|
||||
Reference in new issue
Block a user