Jump to content
  • Advertisement
  • entries
  • comments
  • views

A C64 Game - Step 92

Sign in to follow this  


Poor Sam was left out again. Now he can kill the boss too.


Since the boss is a special beast you wouldn't want Sam just to stand there and kill him without any reaction.

We add a new variable BOSS_HELD, similar to the SPRITE_HELD value.
So if SAM hurts the enemy, and it's the boss, the boss is released from Sam's grip:

          dec SPRITE_HP,x 
          beq .EnemyKilled 
          ;enemy was hurt 
          lda BOSS_HELD 
          beq .EnemyWasHurt 
          ;release if end boss 
          jmp .SamNotFirePushed

BOSS_HELD is set to 1 if Sam has the boss in his force grip. We check if the sprite caught is the last boss or one of his parts:

          ;enemy hit! 
          stx SPRITE_HELD 
          ldy SPRITE_HELD 
          inc SPRITE_HELD 
          lda SPRITE_ACTIVE,y 
          cmp #TYPE_BOSS7 
          beq .HoldingBoss 
          cmp #TYPE_BOSS_PART 
          beq .HoldingBoss 
          jmp .NotHoldingBoss 
          sty BOSS_HELD 
          inc BOSS_HELD

Therefore we also need to clear the bit in case the enemy or Sam is killed:

!zone KillEnemy
          ;is the enemy currently held? 
          ldy SPRITE_HELD 
          sty PARAM4 
          cpx PARAM4 
          bne .WasNotHeld 
          lda #0 
          sta SPRITE_HELD 
          sta BOSS_HELD

Obviously the boss should not move when being caught, so in BehaviourBoss7 we add an early bail out:

          lda BOSS_HELD 
          beq + 

The step also adds a few bug fixes, as in the boss not auto-moving the bats he spawned (as if they were body parts).

Have fun!


Previous Step Next Step

Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!