Skip to content
Game 5 Unit 20 of 128 1 hr learning time

Title Screen Animation

Add colour cycling to the title screen for a professional, eye-catching first impression.

16% of Ink War

First impressions matter. An animated title screen says “this is a polished game” before the player even starts.

Run It

Assemble and run:

pasmonext --sna inkwar.asm inkwar.sna

Unit 20 Screenshot

Version shows “PHASE 2 V0.4”. Watch the “INK WAR” title cycle through colours.

Colour Cycling

The Spectrum’s attribute system makes colour cycling easy—just change the paper colour:

animate_title:
            ; Get colour from frame counter
            ld      a, (frame_counter)
            and     %01110000           ; Use bits 4-6 for slower cycling
            rrca
            rrca
            rrca
            rrca                        ; Now 0-7 in low bits

            ; Map to colour attributes
            cp      0
            jr      z, .red
            cp      1
            jr      z, .yellow
            ; ... etc

Using bits 4-6 means the colour changes every 16 frames (about 3 times per second).

The Colour Sequence

We cycle through the Spectrum’s bright colours:

StepColourAttribute
0Red%01010111
1Yellow%01110111
2Green%01100111
3Cyan%01101111
4Blue%01001111
5Magenta%01011111
6White%01111000
7Red(cycle repeats)

White uses black ink for contrast; others use white ink.

Calling Every Frame

The animation runs during the title state:

state_title:
            ; Animate title colours
            call    animate_title

            ; Check for key presses...

This ensures smooth animation while waiting for input.

The Complete Code

What You’ve Learnt

  • Title animation - Makes the game feel alive before play
  • Colour cycling - Simple but effective visual effect
  • Frame-based timing - Using counter bits for different speeds
  • First impressions - Professional presentation matters

What’s Next

Unit 21 adds title music—a simple beeper melody that plays while waiting.

What Changed

Unit 19 → Unit 20