What the screen dump doesn't show is the text colours "animating" across the screen, left and right.
I had also previously decided it may be quite nice to make the title logo sprites move up and down continuously.
I was quite surprised how easy it was to do the "bounce". In the mainline title screen loop, I just needed some code that added or subtracted a pixel from each sprites y position and then saved the new position into the sprite table to picked up by the sprite plotter in the interrupt code.
There was an extra table added that kept track of whether the sprite was moving up or down so the code knew whether to move the sprite up/down after checking if each sprite had reached it's top or bottom limit.
Here's the code to do the bounce; it may be possible to refine it in the future, but it works as it stands at the moment!
; update title sprites 'y' position to 'bounce' them
ldx bounce_timer ; load up the bounce_timer
inx ; increase it by '1'
cpx #$03 ; is the timer equal to '4' yet?
bne bounce_skip ; no? don't update movement
; yes? better do some moving then!
ldx #$00
t_sprite_y_upd
lda t_spr_y_dir,x
cmp #$01
beq t_sprite_up
lda sprite_y,x
clc
adc #$02
sta sprite_y,x
cmp #$4a
bcc t_next_sprite
lda #$01
sta t_spr_y_dir,x
jmp t_next_sprite
t_sprite_up
lda sprite_y,x
sec
sbc #$02
sta sprite_y,x
cmp #$3e
bcs t_next_sprite
lda #$00
sta t_spr_y_dir,x
jmp t_next_sprite
t_next_sprite
inx
cpx #$08
bne t_sprite_y_upd
ldx #$00 ; load x register with '0'
bounce_skip ; to reset anim_timer and...
stx bounce_timer ; store x register to anim_timer
I also extracted the text scroller/plotter from "Unused Shmup Tunes" (see previous diary entry) to use on the title screen, so now intro/credit/greeting type text "types" itself on to the screen just above the ground.
As an afterthought, I decided it might be quite nice to have some sprites in the bottom part of the screen, since the screen is already split and therefore it's quite easy to recycle the sprites. It struck me that it might be cool looking to use the ghost that is already in the sprite bank and "fly" it across the screen to write and erase the scrolling message.
Again this was quite easy. When each letter of the message is "plotted" onto the the screen, the ghost moves from left to right by 4 pixels at a time so it appears he is plotting the text. A cheat really, but visually it works.
Finally, I decided to alter the title screen layout slightly to make more room at the bottom of the screen between "The Boy" and "The Girl" text to include the actual sprites of the boy and girl. Another afterthought resulted in me making them dance in time to the music (yes, I have been venturing into Goattracker and toying with some sounds).
The decision to dance the sprites did mean a short trip into the sprite editor to adjust the main player sprites to add some dancing frames, but the boy and girl look happy enough having a boogie to an early version of the title screen music now!
Next diary entry...


No comments:
Post a Comment