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

Control Options

Allow players to choose between QAOP and cursor key control schemes.

23% of Ink War

Different players prefer different control layouts. Offering choices improves accessibility.

Run It

pasmonext --sna inkwar.asm inkwar.sna

Unit 29 Screenshot

Version shows “PHASE 2 V0.13”.

Control Schemes

SchemeUpDownLeftRight
QAOPQAOP
Cursors7658

Both use Space for action.

Implementation

Use a control scheme variable:

control_scheme: defb    0       ; 0=QAOP, 1=Cursors

read_keyboard:
            ld      a, (control_scheme)
            or      a
            jr      z, .read_qaop
            jr      .read_cursors

The Complete Code

What You’ve Learnt

  • Control abstraction - Separating input from action
  • User preferences - Respecting player choices
  • Keyboard layouts - Different Spectrum key groupings

What’s Next

Unit 30 adds a help screen explaining the game.

What Changed

Unit 28 → Unit 29