Jump to content

  • Log In with Google      Sign In   
  • Create Account





A C64 Game - Step 91

Posted by Endurion, in C64 16 March 2013 · 812 views

Aaaand the torso gets to fight back too, not only sit put.


Attached Image


Time to reuse existing code again. The torso will spit out bats just like the last two bossed did. SPRITE_MODE_POS is used to stop the attacking mode and revert back to movement.

A contains the number of boss parts killed (so 4 = 2 legs plus 2 arms):
		  cmp #4

		  bne +
		  ;attack with bats

		  lda SPRITE_CHAR_POS_X,x

		  sta PARAM1

		  lda SPRITE_CHAR_POS_Y,x

		  clc

		  adc #4

		  sta PARAM2

		  inc PARAM2

		  stx PARAM10

		 

		  jsr GenerateRandomNumber

		  and #$01

		  beq .NoBatLeft
		  jsr FindEmptySpriteSlot

		  beq ++

		 

		  lda #TYPE_BAT_ATTACKING

		  sta PARAM3

		  jsr SpawnObject

		  lda #0

		  sta SPRITE_DIRECTION,x

.NoBatLeft

		  jsr GenerateRandomNumber

		  and #$01

		  beq .NoBatRight
		  jsr FindEmptySpriteSlot

		  beq ++
		  jsr SpawnObject

		  lda #1

		  sta SPRITE_DIRECTION,x

++		 

.NoBatRight

		  ldx CURRENT_INDEX

		 

		  lda SPRITE_MODE_POS,x

		  cmp #20

		  bne +++

				   

		  dec SPRITE_STATE,x

		  lda #0

		  sta SPRITE_MODE_POS,x

+++

		  rts


+

That's all there is for this step Posted Image


Previous Step Next Step

Attached Files






great job :)

December 2014 »

S M T W T F S
 123456
78910111213
14151617181920
21 22 2324252627
28293031   
PARTNERS