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

Move Timer

Add optional time limits for moves, creating pressure and faster-paced games.

19% of Ink War

Time pressure transforms a thoughtful strategy game into an exciting race against the clock.

Run It

pasmonext --sna inkwar.asm inkwar.sna

Unit 24 Screenshot

Version shows “PHASE 2 V0.8”.

Timer Design

SettingFramesSeconds
Fast2505
Normal50010
Slow75015
Off0

When timer expires, make a random valid move automatically.

Timer Display

Show remaining time prominently:

            ; Calculate seconds from frames
            ld      a, (move_timer)
            ; Divide by 50 for seconds
            ; Display at fixed position

The Complete Code

What You’ve Learnt

  • Frame-based timers - Using frame count for game timing
  • Timer display - Converting frames to readable seconds
  • Timeout handling - Automatic actions on expiry
  • Game pressure - How time limits change play style

What’s Next

Unit 25 adds statistics tracking across game sessions.

What Changed

Unit 23 → Unit 24