DYSTOPIANPIXEL

Configuration

Configure playerControl V1.0 movement, controls, animation and collision using the complete categorised parameter reference.

playerControl Driver artwork
playerControl Driver · V1.0 guide.

Configuration

The complete public parameter set
CategoryIDParameterDefault
Collision0-11solidMaskRow0..11level data
12-23ladderMaskRow0..11level data
Driver24enabled0
Sprite25visible1
26spriteNumber24
Position27startDirection0
32startX56
33startY160
38spriteOffsetX8
39spriteOffsetY1
Boundaries34minX16
35maxX271
36minY16
37maxY207
Movement40walkSpeed6
41sprintSpeed10
42decelerationInterval8
43decelerationStep1
44climbSpeed12
45climbSprintSpeed20
Physics48gravity4
49maxFallSpeed32
50jumpStrength64
51superJumpEnabled0
52superJumpStrength64
Animation56initialPattern0
57idlePattern0
58normalPatternBase0
59normalPatternCount8
60ladderPatternBase8
61ladderPatternCount4
62normalAnimDistance64
63ladderAnimStep40
Controls64leftKey$DF02
65rightKey$DF01
66upKey$FB01
67downKey$FD01
68jumpKey$7F01
69sprintKey$7F04
70inputMode0
71joystickType0

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 + spriteOffsetY

The V1 defaults are:

spriteOffsetX = 8
spriteOffsetY = 1

That 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,64

Parameter 51 controls whether the super jump is available:

DRIVER 6,1,51,1

enables it, while:

DRIVER 6,1,51,0

disables it.

Normal jump and super jump

The three jump settings are:

50  jumpStrength
51  superJumpEnabled
52  superJumpStrength

Both 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,96

The 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:

  1. jump normally;
  2. release the jump button;
  3. 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..11

Together 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 ladderAnimStep

normalAnimDistance 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   M

Their parameter IDs are:

64 leftKey
65 rightKey
66 upKey
67 downKey
68 jumpKey
69 sprintKey

A key is encoded as a 16-bit value:

high byte = Spectrum keyboard row
low byte  = key mask

For 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,$FE04

That gives:

A = left
D = right
W = up
S = down
Z = jump
X = sprint

The 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,1

Use both keyboard and joystick with:

DRIVER 6,1,71,0
DRIVER 6,1,70,2

The input modes are:

0 keyboard only
1 Kempston only
2 keyboard + Kempston

joystickType=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 down

The 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 f

The 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 5000

A 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,1

Disable it:

DRIVER 6,1,24,0

Visibility is independent:

DRIVER 6,1,25,0

hides 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.