DYSTOPIANPIXEL
PHASELOCK / NEXTBASIC / DYSTOPIAN PIXEL

Stage 4 — Establish one-press, one-tile control

Build a top-down phase puzzle game, one hardware-tested development stage at a time.

MILO in the Blue and Amber Phase Grid
Concept artwork · PHASELOCK development tutorial through v0.13.

The first playable NextBASIC milestone was deliberately small: load the player assets, display the robot, show the controls at the top of the screen and allow the player to move around the visible sprite area, including the sprite border.

Control contract

KeyDirectionCurrent pattern base
QUp0
ADown8
OLeft12
PRight4

One press means one tile. Holding a key must not repeatedly stream movement. After a key has caused a move, the program waits until INKEY$ returns an empty string before accepting the next command. This release gating makes movement deterministic and suitable for a puzzle game.

Input loop and key-release gating

3000 DEFPROC gameLoop()
3010 REPEAT
3020 LET k$=INKEY$
3030 IF k$="q" OR k$="Q" THEN PROC moveUp()
3040 IF k$="a" OR k$="A" THEN PROC moveDown()
3050 IF k$="o" OR k$="O" THEN PROC moveLeft()
3060 IF k$="p" OR k$="P" THEN PROC moveRight()
3070 IF k$<>"" THEN PROC waitRelease()
3080 REPEAT UNTIL 0
3090 ENDPROC

4000 DEFPROC waitRelease()
4010 REPEAT
4020 REPEAT UNTIL INKEY$=""
4030 ENDPROC

Sprite border

SPRITE BORDER 1 is enabled so hardware sprites can use the border area. The early movement test proved that the player can navigate through the full sprite coordinate region rather than being restricted to the 256×192 ULA paper area.