diff --git a/atlantico/atlantico.asm b/atlantico/atlantico.asm index 37fb20f..ca21cf9 100755 --- a/atlantico/atlantico.asm +++ b/atlantico/atlantico.asm @@ -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: diff --git a/atlantico/atlantico.nes b/atlantico/atlantico.nes index c559f0d..a4f6eb7 100644 Binary files a/atlantico/atlantico.nes and b/atlantico/atlantico.nes differ diff --git a/atlantico/atlantico.o b/atlantico/atlantico.o index 4cc8e05..7ecf7aa 100644 Binary files a/atlantico/atlantico.o and b/atlantico/atlantico.o differ