Your place is saved automatically on this browser.
Configuration
The complete public parameter set
| Category | ID | Parameter | Default |
|---|---|---|---|
| Collision | 0-11 | solidMaskRow0..11 | level data |
| 12-23 | ladderMaskRow0..11 | level data | |
| Driver | 24 | enabled | 0 |
| Sprite | 25 | visible | 1 |
| 26 | spriteNumber | 24 | |
| Position | 27 | startDirection | 0 |
| 32 | startX | 56 | |
| 33 | startY | 160 | |
| 38 | spriteOffsetX | 8 | |
| 39 | spriteOffsetY | 1 | |
| Boundaries | 34 | minX | 16 |
| 35 | maxX | 271 | |
| 36 | minY | 16 | |
| 37 | maxY | 207 | |
| Movement | 40 | walkSpeed | 6 |
| 41 | sprintSpeed | 10 | |
| 42 | decelerationInterval | 8 | |
| 43 | decelerationStep | 1 | |
| 44 | climbSpeed | 12 | |
| 45 | climbSprintSpeed | 20 | |
| Physics | 48 | gravity | 4 |
| 49 | maxFallSpeed | 32 | |
| 50 | jumpStrength | 64 | |
| 51 | superJumpEnabled | 0 | |
| 52 | superJumpStrength | 64 | |
| Animation | 56 | initialPattern | 0 |
| 57 | idlePattern | 0 | |
| 58 | normalPatternBase | 0 | |
| 59 | normalPatternCount | 8 | |
| 60 | ladderPatternBase | 8 | |
| 61 | ladderPatternCount | 4 | |
| 62 | normalAnimDistance | 64 | |
| 63 | ladderAnimStep | 40 | |
| Controls | 64 | leftKey | $DF02 |
| 65 | rightKey | $DF01 | |
| 66 | upKey | $FB01 | |
| 67 | downKey | $FD01 | |
| 68 | jumpKey | $7F01 | |
| 69 | sprintKey | $7F04 | |
| 70 | inputMode | 0 | |
| 71 | joystickType | 0 |
IDs 28-31, 46-47 and 54-55 are reserved.
ID 53 is deliberately reserved/game-side in V1.0. Use the completed-fall API instead.
The coordinate system
startX and startY are the player's logical gameplay position. They are not the top-left pixel of the hardware sprite.
The sprite is drawn using separate offsets:
sprite X = logical X + spriteOffsetX
sprite Y = logical Y + spriteOffsetYThe V1 defaults are:
spriteOffsetX = 8
spriteOffsetY = 1That separation is useful. Collision can remain attached to the logical player position while the artwork is shifted independently.
A practical starting configuration
This gives the familiar V1 movement values:
DRIVER 6,1,32,56
DRIVER 6,1,33,160
DRIVER 6,1,34,16
DRIVER 6,1,35,271
DRIVER 6,1,36,16
DRIVER 6,1,37,207
DRIVER 6,1,38,8
DRIVER 6,1,39,1
DRIVER 6,1,40,6
DRIVER 6,1,41,10
DRIVER 6,1,42,8
DRIVER 6,1,43,1
DRIVER 6,1,44,12
DRIVER 6,1,45,20
DRIVER 6,1,48,4
DRIVER 6,1,49,32
DRIVER 6,1,50,64
DRIVER 6,1,51,0
DRIVER 6,1,52,64Parameter 51 controls whether the super jump is available:
DRIVER 6,1,51,1enables it, while:
DRIVER 6,1,51,0disables it.
Normal jump and super jump
The three jump settings are:
50 jumpStrength
51 superJumpEnabled
52 superJumpStrengthBoth strength values are positive magnitudes. The driver converts them to the internal upward velocity.
A useful test is:
DRIVER 6,1,50,32
DRIVER 6,1,51,1
DRIVER 6,1,52,96The first jump will be deliberately weaker and the second rising jump much stronger, making it easy to see that the two values are independent.
The super jump is edge-triggered:
- jump normally;
- release the jump button;
- press it again while still rising.
Holding the button does not repeatedly jump. A third press during the same rise is ignored, and a falling player cannot super jump.
Collision and ladders
The level supplies two sets of twelve 16-bit row masks:
0..11 solidMaskRow0..11
12..23 ladderMaskRow0..11Together they describe the driver's current 16-column by 12-row collision window.
This is deliberately data-driven: the movement code does not need to know what your level graphics look like. Your level code simply supplies the solid and ladder occupancy masks.
Landing on the top of a ladder behaves like landing on an ordinary platform. The player does not suddenly snap into ladder mode or switch to ladder artwork. Climbing state is entered when the player actually climbs.
Animation
The main animation parameters are:
56 initialPattern
57 idlePattern
58 normalPatternBase
59 normalPatternCount
60 ladderPatternBase
61 ladderPatternCount
62 normalAnimDistance
63 ladderAnimStepnormalAnimDistance is distance-based rather than just a timer.
With the default value of 64, the normal walking animation advances every four pixels of accepted horizontal movement.
Lower values animate faster. Higher values animate more slowly.
ladderAnimStep controls the ladder animation accumulator. The default is 40. A value of 0 freezes the ladder frame.
Redefining the keyboard
The default keys are:
Left O
Right P
Up Q
Down A
Jump SPACE
Sprint MTheir parameter IDs are:
64 leftKey
65 rightKey
66 upKey
67 downKey
68 jumpKey
69 sprintKeyA key is encoded as a 16-bit value:
high byte = Spectrum keyboard row
low byte = key maskFor example, an alternative WASD-style setup using Z and X is:
DRIVER 6,1,64,$FD01
DRIVER 6,1,65,$FD04
DRIVER 6,1,66,$FB02
DRIVER 6,1,67,$FD02
DRIVER 6,1,68,$FE02
DRIVER 6,1,69,$FE04That gives:
A = left
D = right
W = up
S = down
Z = jump
X = sprintThe same configured jump action is used by both the normal-jump and super-jump logic. Physical SPACE is not special.
Kempston joystick
V1.0 supports Kempston 1 through port $1F.
Select joystick-only mode with:
DRIVER 6,1,71,0
DRIVER 6,1,70,1Use both keyboard and joystick with:
DRIVER 6,1,71,0
DRIVER 6,1,70,2The input modes are:
0 keyboard only
1 Kempston only
2 keyboard + KempstonjoystickType=0 means Kempston. Values 1 to 255 are reserved in V1.0.
Sprinting with a one-button joystick
A classic Kempston joystick only gives us directions and Fire, so the driver uses a double-tap gesture for sprinting:
Right -> release -> Right + hold = sprint right
Left -> release -> Left + hold = sprint left
Up -> release -> Up + hold = climb sprint up
Down -> release -> Down + hold = climb sprint downThe second press must happen within roughly 200 ms.
Fire performs the normal jump. Release Fire and press it again while rising to perform the super jump when enabled.
Detecting a dangerous fall
The driver measures completed physical falls and makes the result available to the game:
DRIVER 6,2 TO fThe value is returned once and then cleared.
The driver deliberately does not decide whether the fall is dangerous. That remains a game rule.
For example:
DRIVER 6,2 TO f
IF f>6 THEN GO TO 5000A walk from a ledge starts measuring at the ledge. A jump starts its eventual fall measurement at the apex. Climbing down a ladder does not count as a fall, and catching a ladder cancels an incomplete fall.
Enabling and hiding the player
Enable player control:
DRIVER 6,1,24,1Disable it:
DRIVER 6,1,24,0Visibility is independent:
DRIVER 6,1,25,0hides the sprite artwork while the movement system can continue to operate.
That can be useful during death sequences, transitions or other game effects.
V1.0 boundaries
playerControl V1.0 is intended as a reusable platform-game controller, but it does have a defined V1 model.
The collision system uses a 16 x 12 mask window, and the frozen horizontal collision path retains its logical X safety range of 16 to 271. The public X bounds can narrow that range but do not expand it.
Large scrolling worlds are therefore something to integrate around the player-control layer rather than a reason to rewrite the now-frozen V1 movement logic.
