score increment

This commit is contained in:
Tyrel Souza 2023-01-24 23:43:58 -05:00
parent 0a94e9424d
commit 35e4e72c00
No known key found for this signature in database
GPG Key ID: F3614B02ACBE438E
3 changed files with 20 additions and 19 deletions

View File

@ -464,21 +464,25 @@ EndRoutine:
cmp #ActorType::AIRPLANE
bne NextEnemy ; If not an airplane - skip to next enemy type
;; LOAD BOUNDING BOX X1,Y1,X2,Y2
lda ActorsArray+Actor::XPos,x ; Bounding Box X1Y1
sta ParamRectX1
lda ActorsArray+Actor::YPos,y
sta ParamRectY1
lda ActorsArray+Actor::Type,x ; Load the type of the actor we are looping
cmp #ActorType::AIRPLANE
bne NextEnemy ; If it's NOT Airplane, bypass this enemy and move check the next one
lda ActorsArray+Actor::XPos,x ; Bounding Box X2Y2
clc
adc #22 ; Get right value of the airplane bounding box by adding 22
sta ParamRectX2
;; LOAD BOUNDING BOX X1, Y1, X2, and Y2
lda ActorsArray+Actor::XPos,x ; Bounding Box X1
sta ParamRectX1
lda ActorsArray+Actor::YPos,x ; Bouding Box Y1
sta ParamRectY1
lda ActorsArray+Actor::YPos,y ; Bottom of box by adding 8, one sprite tall
clc
adc #8
sta ParamRectY2
lda ActorsArray+Actor::XPos,x
clc
adc #22 ; Get right value of the airplane bounding box by adding 22 pixels to the right
sta ParamRectX2 ; Bounding Box X2
lda ActorsArray+Actor::YPos,x
clc
adc #8 ; Get the bottom of the airplane bounding box by adding 8
sta ParamRectY2 ; Bouding Box Y2
jsr IsPointInsideBoundingBox
@ -568,7 +572,7 @@ FinishCollisionCheck:
adc #3
sta ParamXPos ; Missile position to be checked X += 3
lda ActorsArray+Actor::YPos,y
lda ActorsArray+Actor::YPos,x
clc
adc #1
sta ParamYPos ; Missile position to be checked Y += 1
@ -579,8 +583,9 @@ FinishCollisionCheck:
beq NoCollisionFound
lda #ActorType::NULL ; Delete missile Actor
sta ActorsArray+Actor::Type,x
;; TODO: increment Score
jsr IncrementScore
jsr DrawScore
NoCollisionFound:
@ -1054,10 +1059,6 @@ SetGameClock:
inc Clock60 ; But if it is 60, then increment Clock60 and zero Frame counter
lda #0
sta Frame
;; TODO: REMOVE
jsr IncrementScore
jsr DrawScore
:
SetDrawComplete:

Binary file not shown.

Binary file not shown.