• entries
    104
  • comments
    101
  • views
    257694

A C64 Game - Step 90

Sign in to follow this  

1331 views

And the boss got a bit more lively (visually), it was quite stiff previously. Moving body parts and the head screams (also visually) when getting hurt.

step90.png


The boss helper code is enhanced by a routine doing circling movements:

          jsr GenerateRandomNumber
          and #$03
          bne .DoY

          inc SPRITE_MOVE_POS,x
          lda SPRITE_MOVE_POS,x
          and #$0f
          sta SPRITE_MOVE_POS,x
          ldy SPRITE_MOVE_POS,x
          lda BOSS_DELTA_TABLE_X,y
          beq .DoY
          sta PARAM1

          bmi .Left

.Right
          jsr MoveSpriteRight
          dec PARAM1
          bne .Right
          jmp .DoY

.Left
          jsr MoveSpriteLeft
          inc PARAM1
          bne .Left

.DoY
          jsr GenerateRandomNumber
          and #$03
          bne .Done
          inc SPRITE_MOVE_POS_Y,x
          lda SPRITE_MOVE_POS_Y,x
          and #$0f
          sta SPRITE_MOVE_POS_Y,x
          ldy SPRITE_MOVE_POS_Y,x
          lda BOSS_DELTA_TABLE_Y,y
          beq .Done
          sta PARAM1

          bmi .Up

.Down
          jsr MoveSpriteDown
          dec PARAM1
          bne .Down
          jmp .Done

.Up
          jsr MoveSpriteUp
          inc PARAM1
          bne .Up

.Done
          rts


Plus a rather simple swinging table:

BOSS_DELTA_TABLE_X
          !byte 0, 1, 0, 1, 1, 0, 1, 0
BOSS_DELTA_TABLE_Y
          !byte 0, $ff, 0, $ff, $ff, 0, $ff, 0
          !byte 0, 1, 0, 1, 1, 0, 1, 0

 


To make the boss' head scream we adjust its hurt routine:

 

;------------------------------------------------------------
;hit behaviour getting hurt
;------------------------------------------------------------
!zone HitBehaviourBoss7
HitBehaviourBoss7
          lda #SPRITE_BOSS_HEAD_HURT
          sta SPRITE_POINTER_BASE,x
          jmp HitBehaviourHurt

 

step90.zip


Previous Step Next Step

 

 
Sign in to follow this  


0 Comments


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