🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

A C64 Game - Step 61

posted in New Old Things
Published July 28, 2012
Advertisement

And a little gimmick: Did you notice the black sewage in some of the later stages? Now it affects everything that's inside, as it's slowing down enemies and the players.




The change is surprisingly simple. We have a function named ObjectControl, which is called every frame to update all objects. We simply check if an object is inside sewage. If it is, we skip every fourth update:

          lda DELAYED_GENERIC_COUNTER
          and #$03
          bne +

          ;check if we're in water
          ldy SPRITE_CHAR_POS_Y,x
          lda SCREEN_LINE_OFFSET_TABLE_LO,y
          sta ZEROPAGE_POINTER_1
          lda SCREEN_BACK_LINE_OFFSET_TABLE_HI,y
          sta ZEROPAGE_POINTER_1 + 1
          lda SPRITE_CHAR_POS_X,x
          tay
          lda (ZEROPAGE_POINTER_1),y
          cmp #111
          beq .NextObject

+
          ldy SPRITE_ACTIVE,x
          ... update object

The update calls are still fast enough so no joystick movements are skipped. Yay!

step61.zip

Previous Step Next Step

Previous Entry A C64 Game - Step 60
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement