Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!






A C64 Game - Step 92

Posted by Endurion, in C64 23 March 2013 · 657 views

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

Attached Image

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:
.EnemyHit		 

		  ;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

		 

.HoldingBoss		 

		  sty BOSS_HELD

		  inc BOSS_HELD

.NotHoldingBoss


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

KillEnemy

		  ;is the enemy currently held?

		  ldy SPRITE_HELD

		  dey

		  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:
.NoHitBack

		  lda BOSS_HELD

		  beq +

		 

		  rts


+


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

Attached Files






May 2015 »

S M T W T F S
     12
3456789
10111213141516
1718192021 22 23
24252627282930
31      
PARTNERS