Skip to content

Instantly share code, notes, and snippets.

@drx
Created November 2, 2017 06:01
Show Gist options
  • Save drx/963a8e6ad01fdf8f7ed8b1ce25a17f88 to your computer and use it in GitHub Desktop.
Save drx/963a8e6ad01fdf8f7ed8b1ce25a17f88 to your computer and use it in GitHub Desktop.
loc_1FD4E:
lea (Player_1).w,a1 ; player = player 1
move.w $30(self),d1 ; vel_x = self.$30
move.w d6,d0 ;
andi.w #1,d0 ;
beq.w check_player2 ; check player 2 collisions if player 1 is not colliding
tst.b (self+subtype) ;
bpl.s subtype_nonzero ; if (subtype != 0) goto loc
cmpi.b #2,$38(a1) ; if (player == knuckles)
beq.s break_wall ; break_wall()
bra.w check_player2 ; else goto check_player2
; ---------------------------------------------------------------------------
loc_1FD72:
tst.b (Super_Sonic_Knux_flag).w ; if (super/hyper sonic/knux)
bne.s break_wall ; break_wall()
cmpi.b #2,$38(a1) ; if (player == knux)
beq.s break_wall ; break_wall()
btst #4,$2B(a1) ; if (fire_shield)
bne.s fire_shield_routine; fire_shield_routine()
btst #5,$2A(self) ; if (sonic_is_pushing_on_wall)
beq.s dont_break ; dont_break()
fire_shield_routine: ; fire_shield_routine()
cmpi.b #2,$20(a1) ; if (sonic.animation != 2)
bne.s loc_1FDEA ; dont_break()
move.w d1,d0 ; vel = vel_x
bpl.s .pos ; if (vel < 0)
neg.w d0 ; vel = -vel
.pos:
cmpi.w #$480,d0 ; if (vel < 0x480)
blo.s loc_1FDEA ; dont_break()
break_wall:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment