Jump to content
  • Advertisement
  • entries
    104
  • comments
    102
  • views
    260233

A C64 Game - Step 65

Sign in to follow this  
Endurion

1656 views

I had several complaints as there was no bullet. Well, after this step there is still none, but you do get a flash  :)


step65.png

When shooting we add this:

          lda #5
          sta PLAYER_RELOAD_FLASH_POS
          lda #1
          sta VIC_BACKGROUND_COLOR


Below the call to ObjectControl we add this snippet to update the flash via the color fade table:

          ;shot flash
          lda PLAYER_RELOAD_FLASH_POS
          beq +

          dec PLAYER_RELOAD_FLASH_POS
          lda VIC_BACKGROUND_COLOR
          and #$0f
          tay
          lda COLOR_FADE_OUT_TABLE,y
          sta VIC_BACKGROUND_COLOR

+


And the color fade table itself:

COLOR_FADE_IN_TABLE
          !byte 11,1,10,1,10,13,14,1,7,8,1,12,15,1,1,1
          
COLOR_FADE_OUT_TABLE
          !byte 0,15,9,14,6,6,11,10,9,11,2,0,11,5,6,12


step65.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
  • 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!