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

Phase 1 Complete

A complete, playable territory control game with AI opponents and full audio-visual polish.

13% of Ink War

Congratulations! You’ve completed Phase 1 of Ink War. Over sixteen units, you’ve built a complete, playable game from scratch. Let’s review what you’ve created and celebrate the milestone.

Run It

pasmonext --sna inkwar.asm inkwar.sna

Unit 16 Screenshot

Load the game and hear the startup jingle — that’s the sound of completion.

See It In Action

Ink War gameplay — players claim cells on an 8×8 board, building territory turn by turn

What You’ve Built

Phase 1 delivers a fully functional territory control game:

Every feature works together to create a polished experience.

The Journey

Here’s how Ink War grew over Phase 1:

UnitsFocusWhat You Built
1-3FoundationBoard display, cursor movement, cell claiming
4-6MechanicsScores, move validation, game end detection
7-8FlowTitle screen, complete two-player game
9-12AIRandom, adjacent, defensive, positional strategies
13-14OptionsDifficulty levels, sound effects
15-16PolishResults screen, startup sound, final verification

Each unit built on the previous, adding one clear feature at a time.

Final Polish: Startup Sound

The startup jingle gives immediate feedback that the game has loaded:

Three quick ascending notes — a small touch that makes the game feel finished.

Verification Checklist

Before moving to Phase 2, verify everything works:

Two-Player Mode:

  • ✓ Both players can claim cells
  • ✓ Turns alternate correctly
  • ✓ Invalid moves show error feedback
  • ✓ Game ends when board is full
  • ✓ Winner displayed with margin

AI Easy:

  • ✓ Makes random valid moves
  • ✓ Easy to beat consistently

AI Medium:

  • ✓ Builds connected territory
  • ✓ Moderate challenge

AI Hard:

  • ✓ Blocks opponent expansion
  • ✓ Prioritises corners and edges
  • ✓ Provides strong competition

Audio:

  • ✓ Startup jingle plays on load
  • ✓ Claim sounds on valid moves
  • ✓ Error buzz on invalid moves
  • ✓ Victory fanfare when winning
  • ✓ Draw sound on tie

The Complete Code

Code Statistics

The complete Phase 1 game in numbers:

MetricCount
Lines of code~2,300
Subroutines~40
Sound effects6
AI strategies3
Game states3

All of this fits comfortably in the Spectrum’s memory.

What You’ve Learnt

Phase 1 covered fundamental skills:

ZX Spectrum Display:

  • Attribute memory ($5800-$5AFF)
  • FBPPPIII format (Flash, Bright, Paper, Ink)
  • Screen memory organisation
  • Border colour control

Z80 Assembly:

  • Registers and addressing modes
  • Arithmetic and logic operations
  • Control flow (jumps, calls, loops)
  • Keyboard input via ports

Game Development:

  • Game loop structure
  • State machine patterns
  • Input handling and validation
  • AI decision-making

Audio:

  • Beeper sound generation
  • Timing-based pitch control
  • Musical sequences

What’s Next

Phase 2 transforms Ink War from functional to impressive:

  • Custom character sets — Replace ROM characters with custom graphics
  • Animations — Cursor pulsing, claim effects, screen transitions
  • Title music — A proper musical introduction
  • Options menu — Sound on/off, board size selection
  • Board variations — 6×6 boards for quicker games
  • Statistics — Track wins, losses, best margins

The foundation is solid. Phase 2 adds the polish that makes a game memorable.

Phase 1 Complete

You’ve built a real game. Not a tutorial example, not a code snippet — a complete, playable territory control game with multiple modes, intelligent AI, and audio feedback.

Hand the keyboard to a friend and play Ink War. You made this.

See you in Phase 2.

What Changed

Unit 15 → Unit 16