Calculate gains after sort results bug fixed

This commit is contained in:
Pecusx
2023-05-13 12:46:15 +02:00
parent 663321be99
commit af101d46e9
3 changed files with 22 additions and 17 deletions
+22 -17
View File
@@ -45,6 +45,8 @@ MainGameLoop
bit escFlag bit escFlag
bmi START bmi START
jvs GoGameOver jvs GoGameOver
jsr CalculateGains
jsr SortSequence jsr SortSequence
@@ -67,10 +69,21 @@ MainGameLoop
jsr DemoModeOrKey jsr DemoModeOrKey
jsr MakeDarkScreen jsr MakeDarkScreen
lda GameIsOver
beq NoGameOverYet
GoGameOver
jsr GameOverScreen
jmp START
NoGameOverYet
inc CurrentRoundNr
mva #sfx_silencer sfx_effect
ldx NumberOfPlayers jmp MainGameLoop
dex
CalculateGains ;--------------------------------------------------
.proc CalculateGains
;--------------------------------------------------
; add gains and substract losses ; add gains and substract losses
; gain is what player gets for lost energy of opponents ; gain is what player gets for lost energy of opponents
; energy lost by opponents is added during Round and ; energy lost by opponents is added during Round and
@@ -80,6 +93,9 @@ CalculateGains
; Important! If player has 10 energy and gets a central hit ; Important! If player has 10 energy and gets a central hit
; from nuke that would take 90 energy points, his loss ; from nuke that would take 90 energy points, his loss
; is 90, not 10 ; is 90, not 10
ldx NumberOfPlayers
dex
CalculateGainsLoop
; adding the remaining energy of the tank to gain ; adding the remaining energy of the tank to gain
; winner gets more ! :) ; winner gets more ! :)
@@ -155,20 +171,9 @@ ezeromoney
eskipzeroing eskipzeroing
dex dex
jpl CalculateGains jpl CalculateGainsLoop
rts
lda GameIsOver .endp
beq NoGameOverYet
GoGameOver
jsr GameOverScreen
jmp START
NoGameOverYet
inc CurrentRoundNr
mva #sfx_silencer sfx_effect
jmp MainGameLoop
;-------------------------------------------------- ;--------------------------------------------------
.proc RoundInit .proc RoundInit
;-------------------------------------------------- ;--------------------------------------------------
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.