Your place is saved automatically on this browser.
Overview
playerControl Driver V1.0 moves the time-sensitive platform-game control loop out of BASIC and into a configurable NextZXOS resident driver. It is the first in an ecosystem of drivers I am planning to develop to help members of the ZX Spectrum Next community who primarily use BASIC to build games while maintaining high performance.
The aim is to allow developers to use BASIC to organise their game structure and logic, while using machine-code-based drivers for the performance-critical parts of the game.
playerControl Driver provides walking, sprinting, gravity, jumping, optional super-jumping, ladder movement, collision masks, configurable animation, redefinable keyboard controls, Kempston joystick support and completed-fall reporting.
The driver grew out of a requirement I encountered while developing The Lost Caverns, a 2D platformer inspired by a set of game assets created by Gaz Marshall: https://gazmarshall.itch.io/caverns-zx-spectrum-next.
As the BASIC codebase grew, the performance of the player character began to suffer. Moving the time-sensitive control and physics code into a resident machine-code driver provided a way to retain the accessibility and flexibility of BASIC while significantly improving performance.
Planning for Version 2 is already under way, including player-owned weapons and projectiles with consistent combat behaviour across playerControl, shipControl and enemyControl. These are future additions; this tutorial continues to cover the established V1.0 platform controls.
V1.0 highlights
- Tested on real ZX Spectrum Next hardware
- Configurable movement and physics
- Solid and ladder-mask collision
- Normal jump and optional super jump
- Ladder climbing and ladder sprinting
- Configurable sprite and animation setup
- Redefinable keyboard controls
- Kempston joystick support
- Keyboard, joystick and combined input modes
- Double-tap joystick sprint
- Completed-fall telemetry
- Source code and API documentation included
