Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!






A C64 Game - Step 62

Posted by Endurion, in C64 04 August 2012 · 815 views

Time to get rid of the old ugly Get Ready display. And put up a new ugly one.

Attached Image

The changes are pretty easy, we modify our DisplayGetReady routine to display the sprites now (and store the old sprite settings):

;------------------------------------------------------------
;displays get ready
;------------------------------------------------------------
!zone DisplayGetReady
DisplayGetReady
		  lda #40
		  sta LEVEL_START_DELAY
		  lda #0
		  sta SPRITE_JUMP_POS
		  lda VIC_SPRITE_ENABLE
		  sta SPRITE_ENABLED
		  lda VIC_SPRITE_MULTICOLOR
		  sta SPRITE_MULTICOLOR
		
		  ldx #0
		  ldy #0
		
-		
		  lda GETREADY_SPRITE_X_POS,x
		  sta VIC_SPRITE_X_POS,y
		  lda VIC_SPRITE_COLOR,x
		  sta SPRITE_COLOR,x
		  lda GETREADY_SPRITE_COLOR,x
		  sta VIC_SPRITE_COLOR,x
		  iny
		  iny
		  inx
		  cpx #8
		  bne -
		
		  lda #110
		  sta VIC_SPRITE_Y_POS
		  sta VIC_SPRITE_Y_POS + 2
		  sta VIC_SPRITE_Y_POS + 4
		  sta VIC_SPRITE_Y_POS + 6
		  sta VIC_SPRITE_Y_POS + 8
		  sta VIC_SPRITE_Y_POS + 10
		  sta VIC_SPRITE_Y_POS + 12
		  sta VIC_SPRITE_Y_POS + 14
		
		  lda #SPRITE_G
		  sta SPRITE_POINTER_BASE
		  lda #SPRITE_E
		  sta SPRITE_POINTER_BASE + 1
		  sta SPRITE_POINTER_BASE + 4
		  lda #SPRITE_T
		  sta SPRITE_POINTER_BASE + 2
		  lda #SPRITE_R
		  sta SPRITE_POINTER_BASE + 3
		  lda #SPRITE_A
		  sta SPRITE_POINTER_BASE + 5
		  lda #SPRITE_D
		  sta SPRITE_POINTER_BASE + 6
		  lda #SPRITE_Y
		  sta SPRITE_POINTER_BASE + 7
		
		  lda #0
		  sta VIC_SPRITE_MULTICOLOR
		  lda #$80
		  sta VIC_SPRITE_X_EXTEND
		  lda #$ff
		  sta VIC_SPRITE_ENABLE
		  sta VIC_SPRITE_EXPAND_X
		  sta VIC_SPRITE_EXPAND_Y
		  rts

...and then the remove routine to restore the previous sprite setup:

lda SPRITE_ENABLED
		  sta VIC_SPRITE_ENABLE
		  lda SPRITE_MULTICOLOR
		  sta VIC_SPRITE_MULTICOLOR
		  lda SPRITE_POS_X_EXTEND
		  sta VIC_SPRITE_X_EXTEND
		  lda SPRITE_POS_X
		  sta VIC_SPRITE_X_POS
		  lda SPRITE_POS_X + 1
		  sta VIC_SPRITE_X_POS + 2
		  lda SPRITE_POS_Y
		  sta VIC_SPRITE_Y_POS
		  lda SPRITE_POS_Y + 1
		  sta VIC_SPRITE_Y_POS + 2
		
		
		  ldx #0
		  stx VIC_SPRITE_EXPAND_X
		  stx VIC_SPRITE_EXPAND_Y
-		
		  ldy SPRITE_ACTIVE,x
		  cpy #0
		  bne +
		
--		
		  lda SPRITE_COLOR,x
		  sta VIC_SPRITE_COLOR,x
		  inx
		  cpx #2
		  bne -
		  jmp GameLoop
		
+
		  lda TYPE_START_SPRITE,y
		  sta SPRITE_POINTER_BASE,x
		  jmp --


Also, remember, tables, tables, tables?

One more for the sprite setup:

GETREADY_SPRITE_X_POS
		  !byte 32,67,102,147,182,217,252,48 - 16
		
GETREADY_SPRITE_COLOR
		  !byte 2,3,4,5,6,7,8,9


Previous Step Next Step

Attached Files






November 2014 »

S M T W T F S
      1
2345678
9101112131415
161718192021 22
23242526272829
30      
PARTNERS