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

Binary file not shown.

Binary file not shown.