How to: Add a Sound
below these lines:
Jump Uncontrolled
When rolling, if you make a jump, your jump will be "uncontrolled". This condition is bad after the Homing Attack, because you can't move the Sonic after the bounce.
To correct this, go below these lines:
below these lines:
- Code:
HA_calcdistance2: ; continuation of distance calculator
muls.w d1,d1 ; horizontal distance squared
muls.w d2,d2 ; vertical distance squared
add.l d2,d1 ; add vertical distance to horizontal distance
cmp.l #16384,d1 ; is distance of Sonic, greater than or equal 128 pixels of the object? (128^2=16384 // $80^2=$4000)
bge.s HA_nextobject ; if yes, don't execute the homing attack
- Code:
move.w #$BC,d0 ; set homing attack sound
jsr (PlaySound).l ; play homing attack sound
Jump Uncontrolled
When rolling, if you make a jump, your jump will be "uncontrolled". This condition is bad after the Homing Attack, because you can't move the Sonic after the bounce.
To correct this, go below these lines:
- Code:
move.w #$BC,d0 ; set homing attack sound
jsr (PlaySound).l ; play homing attack sound
- Code:
bclr #4,$22(a0) ; clear "uncontrolled jump" flag