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

Attract Mode

Add AI vs AI demonstration mode that plays when the title screen is idle.

24% of Ink War

Attract mode showcases gameplay without interaction—like a shop window demonstration.

Run It

pasmonext --sna inkwar.asm inkwar.sna

Unit 31 Screenshot

Version shows “PHASE 2 V0.15”.

Implementation

  1. Count idle frames on title screen
  2. After threshold (e.g., 500 frames / 10 seconds), start demo
  3. AI plays both sides
  4. Any key returns to title
idle_timer:     defw    0
ATTRACT_DELAY   equ     500

; In title state:
            ; Check for attract mode
            ld      hl, (idle_timer)
            inc     hl
            ld      (idle_timer), hl
            ld      de, ATTRACT_DELAY
            or      a
            sbc     hl, de
            jr      nc, .start_attract

The Complete Code

What You’ve Learnt

  • Idle detection - Counting frames without input
  • Demo mode - AI controlling both players
  • Attract design - Showcasing game features

What’s Next

Unit 32 completes Phase 2 with final integration and polish.

What Changed

Unit 30 → Unit 31