Skip to content

Commit d5e6e12

Browse files
committed
* Physics tweak: No longer stuttering like crazy while at high velocity + not holding any buttons
1 parent fba218b commit d5e6e12

1 file changed

Lines changed: 26 additions & 9 deletions

File tree

src/p_physic.asm

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1784,20 +1784,28 @@ collidedRight:
17841784
lda player_vl_x
17851785
bmi @dontModVel
17861786

1787-
ldx #0 ; set the velocity to a minuscule value to
1788-
stx player_vl_x ; ensure the player doesn't look idle
1789-
inx
1787+
ldx #0
1788+
stx player_vl_x
17901789
stx player_vs_x
17911790

17921791
: lda playerctrl
1793-
ora #pl_pushing
17941792
and #(pl_wallleft^$FF) ; the wall wasn't found on the left.
17951793
sta playerctrl
17961794

17971795
lda gamectrl5
17981796
ora #g5_collideX
17991797
sta gamectrl5
1800-
jsr gm_check_attach_wall
1798+
1799+
; if holding left, mark as pushing
1800+
lda game_cont
1801+
and #cont_right
1802+
beq :+
1803+
1804+
lda playerctrl
1805+
ora #pl_pushing
1806+
sta playerctrl
1807+
1808+
: jsr gm_check_attach_wall
18011809

18021810
@dontModVel:
18031811
lda #defwjmpcoyo
@@ -1860,18 +1868,27 @@ collidedLeft:
18601868
lda player_vl_x
18611869
bpl @dontModVel
18621870

1863-
ldx #$FF ; set the velocity to a minuscule value to
1864-
stx player_vl_x ; ensure the player doesn't look idle
1871+
ldx #0
1872+
stx player_vl_x
18651873
stx player_vs_x
18661874

18671875
: lda playerctrl
1868-
ora #(pl_pushing | pl_wallleft) ; the wall was found on the left.
1876+
ora #pl_wallleft ; the wall was found on the left.
18691877
sta playerctrl
18701878
lda gamectrl5
18711879
ora #g5_collideX
18721880
sta gamectrl5
18731881

1874-
jsr gm_check_attach_wall
1882+
; if holding left, mark as pushing
1883+
lda game_cont
1884+
and #cont_left
1885+
beq :+
1886+
1887+
lda playerctrl
1888+
ora #pl_pushing
1889+
sta playerctrl
1890+
1891+
: jsr gm_check_attach_wall
18751892

18761893
@dontModVel:
18771894
lda #defwjmpcoyo

0 commit comments

Comments
 (0)