From 4e5267ce1f247bf2c7336d79a16b6cd9a1d1c5ce Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Wed, 2 Apr 2025 21:33:21 +0200 Subject: Full stop when not moving on walking state MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this commit the same logic as in throttle state was applied in which acceleration was applied. This brings back the logic more closely to the original game. Signed-off-by: Miquel Sabaté Solà --- src/player.s | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/player.s') diff --git a/src/player.s b/src/player.s index b900e52..e86c491 100644 --- a/src/player.s +++ b/src/player.s @@ -370,11 +370,16 @@ lda #THROTTLE_RIGHT bne @apply_acceleration - ;; If neither left nor right is being pressed, go for a zero - ;; acceleration, which will slow down the player instead of going to a - ;; full stop. + ;; If neither left nor right is being pressed we have to move to a + ;; resting state on the horizontal axis. When throttling this means an + ;; acceleration of 0 (i.e. slow down), when walking this means going to + ;; an immediate full stop. @nothing: lda #0 + bit zp_state + bmi @apply_acceleration + sta zp_velocity_x + beq @apply_velocity ;; As with vertical motion, `a` contains the acceleration to aim for, ;; and we just subtract the current velocity and see if we either have -- cgit v1.2.3