mirror of
https://github.com/Pecusx/scorch_src.git
synced 2026-05-21 21:34:20 +02:00
Falling sfx only if Tank really falls
This commit is contained in:
BIN
Binary file not shown.
+1
-1
@@ -178,7 +178,7 @@ xcircle .DS 2
|
|||||||
ycircle .DS 2
|
ycircle .DS 2
|
||||||
tempcir .DS 2
|
tempcir .DS 2
|
||||||
;TankFalls
|
;TankFalls
|
||||||
IfFallDown .DS 1
|
FallingSoundBit .DS 1
|
||||||
PreviousFall .DS 1
|
PreviousFall .DS 1
|
||||||
EndOfTheFallFlag .DS 1 ; in case of the infinite fall
|
EndOfTheFallFlag .DS 1 ; in case of the infinite fall
|
||||||
Parachute .DS 1 ; are you insured with parachute?
|
Parachute .DS 1 ; are you insured with parachute?
|
||||||
|
|||||||
+10
-1
@@ -1357,11 +1357,11 @@ ShotUnderGround
|
|||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
.proc TankFalls;
|
.proc TankFalls;
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
mva #sfx_shield_off sfx_effect
|
|
||||||
lda #0
|
lda #0
|
||||||
sta PreviousFall ; bit 7 - left, bit 6 - right
|
sta PreviousFall ; bit 7 - left, bit 6 - right
|
||||||
sta EndOfTheFallFlag
|
sta EndOfTheFallFlag
|
||||||
sta Parachute
|
sta Parachute
|
||||||
|
mva #2 FallingSoundBit ; another trick for only one sfx initialization in loop
|
||||||
|
|
||||||
; let's check if the given tank has got the parachute
|
; let's check if the given tank has got the parachute
|
||||||
ldx TankNr
|
ldx TankNr
|
||||||
@@ -1375,6 +1375,13 @@ ShotUnderGround
|
|||||||
ParachuteActive
|
ParachuteActive
|
||||||
inc Parachute
|
inc Parachute
|
||||||
TankFallsX
|
TankFallsX
|
||||||
|
; sound only if really falls
|
||||||
|
lda Parachute
|
||||||
|
and FallingSoundBit ; bit 1
|
||||||
|
beq NoFallingSound
|
||||||
|
mva #0 FallingSoundBit
|
||||||
|
mva #sfx_shield_off sfx_effect
|
||||||
|
NoFallingSound
|
||||||
; clear previous position
|
; clear previous position
|
||||||
mva #1 Erase
|
mva #1 Erase
|
||||||
jsr DrawTankNr
|
jsr DrawTankNr
|
||||||
@@ -1472,6 +1479,7 @@ NoFallingDown
|
|||||||
bpl @-
|
bpl @-
|
||||||
bmi NoLeftOrRight
|
bmi NoLeftOrRight
|
||||||
FallingLeft
|
FallingLeft
|
||||||
|
; tank is falling left
|
||||||
bit PreviousFall ; bit 6 - right
|
bit PreviousFall ; bit 6 - right
|
||||||
bvs EndLeftFall
|
bvs EndLeftFall
|
||||||
; we finish falling left if the tank reached the edge of the screen
|
; we finish falling left if the tank reached the edge of the screen
|
||||||
@@ -1491,6 +1499,7 @@ NotLeftEdge
|
|||||||
mva #%10000000 PreviousFall ; set bit 7 - left
|
mva #%10000000 PreviousFall ; set bit 7 - left
|
||||||
bne EndOfFCycle
|
bne EndOfFCycle
|
||||||
FallingRight
|
FallingRight
|
||||||
|
; tank is falling right
|
||||||
bit PreviousFall ; bit 7 - left
|
bit PreviousFall ; bit 7 - left
|
||||||
bmi EndRightFall
|
bmi EndRightFall
|
||||||
; we finish falling right if the tank reached the edge of the screen
|
; we finish falling right if the tank reached the edge of the screen
|
||||||
|
|||||||
Reference in New Issue
Block a user