Your place is saved automatically on this browser.
Simple Programme
This example installs playerControl, loads player artwork into two RAM banks, transfers it into the hardware sprite-pattern memory, and configures the driver before enabling movement. Each setting uses DRIVER 6,1,id,value: the parameter ID selects the setting, and the final value supplies its new value.
Put playerControl.drv and your sprite files in the programme’s working folder. The example filenames PLAYER_WALK.SPR and PLAYER_CLIMB.SPR stand for your own artwork: eight walking frames and four climbing frames respectively. They are not included in the driver package. Use raw 8-bit 16 × 16 patterns with colours matching the current sprite palette; each pattern occupies 256 bytes, so these files contain 2,048 and 1,024 bytes.
BANK NEW reserves free RAM banks and stores their numbers in walkBank and climbBank. LOAD … BANK fills those banks with the file data. SPRITE BANK then copies the artwork into hardware patterns 0–7 and 8–11. The bank numbers, pattern numbers and hardware sprite number 24 each identify a different part of the setup.
The existing position, speed, jump and keyboard settings are retained. A simple solid bottom row provides collision data, with no ladders or background artwork in this first example. The climbing frames are loaded ready for a level with ladders. Run it with the driver not already installed; use O and P to move, SPACE to jump, M to sprint, and X to finish. Short comments at the start of each section explain the setup and keep the listing easy to read.
Command reference: NextBASIC · ZX Spectrum Next manual: Time and Motion.
