DYSTOPIANPIXEL

playerControl Driver

Player character control for ZX Spectrum Next platformers. First developed for The Lost Caverns.

Angled blue and gold assembly code beside a player movement and climbing schematic
Illustrative Z80N code and movement schematic for playerControl Driver.
Read the first development story ↗

Behind the adventure

playerControl Driver V1.0 provides configurable platform-game movement on the ZX Spectrum Next, moving the frequent player-control work out of NextBASIC while BASIC supplies the structure of the game. Its movement foundation has been tested on real hardware.

That means BASIC can organise menus, load levels and manage the wider game state, while the driver takes responsibility for the moment-to-moment movement and behaviour of the player character. V1 provides this division of work, with configurable movement, physics and animation, redefinable keyboard controls, Kempston joystick support and keyboard, joystick or combined input modes.

Why I started building it

The Lost Caverns was the first project playerControl was developed for and used in. While building the game in NextBASIC, I wanted the player’s movement to feel smoother and more responsive alongside the other animated elements.

As the BASIC programme grew, handling player movement within the main loop became an area I wanted to improve. The driver grew out of that practical need: to give the character consistent control without making every movement update depend on the rest of the BASIC loop.

Version 1.0 platform controls

  • Walking and running: horizontal movement, changes of speed and facing direction.
  • Jumping and falling: take-off, movement through the air, gravity and landing.
  • Climbing: moving up and down ladders, getting on and off them, and standing at the top.
  • Collision responses: reacting to platforms, blocked paths and the edges of the playing area.
  • Movement states and animation: keeping the character’s appearance in step with what they are doing.

The important part is how these actions work together. Jumping onto a ladder or landing beside an obstruction should lead to a predictable result. These movement and ladder transitions have been checked on real hardware. Later changes should preserve that established behaviour.

How the approach helps

The driver uses machine-code routines and interrupt-driven updates to reduce the amount of player-control work interpreted by BASIC. Regular update opportunities are intended to make movement more consistent while BASIC continues with the wider game logic. The driver still shares the processor with the game, so its routines need to be efficient.

playerControl builds on Simon N Goodwin’s Z80 SpriteHax routines. The Ideas pages explain that foundation and link to his book and companion material. No benchmark figures or final performance guarantees have been published yet.

Simon N Goodwin’s book and code

Next Tech: Get the Best from your ZX Spectrum Next explains the routines behind this work. SpriteHax accompanies Chapter 12; the supporting slot driver accompanies Chapters 10 and 11.

Buy Next Tech on Amazon UK ↗Download SpriteHax code (ZIP) ↓Download slot driver code (ZIP) ↓

These downloads are Simon’s original companion code. Visit his book page for documentation, updates and usage terms.

Developing it in a real game

The Lost Caverns provided the first practical setting for the driver, with platforms, ladders and hazards helping establish the hardware-tested movement baseline. V1 configuration makes those controls adaptable to other platform games, while further examples and Version 2 work will build on that first implementation.

Version 2: a wider combat role

The next-version plan now includes player-owned weapons and projectiles. playerControl, shipControl and enemyControl will use consistent firing, projectile and damage behaviour while retaining their own movement responsibilities.

This is planned V2 work. It leaves the existing platform-control foundation intact, with BASIC continuing to decide lives, score, death sequences, respawning and pickup rewards. Explore the future plans ↗

World-aware multiplayer is planned

The broader V2 plan adds up to four players, separate controls, world movement limits, forces, slopes and moving-platform cooperation. These are planned additions to the available V1 driver. See the Ideas pages for the complete scope and current progress.

DOCUMENTATION & DOWNLOADS

Project files to follow

No driver package or technical documentation is published here yet. Setup instructions, usage examples and release notes will accompany the files when they are shared.

First used in The Lost Caverns

Follow the game’s development and explore the concept art for its world and characters.

Explore the game ↗View the concept art ↗