playerControl Driver

Last updated: · On hold
Agreed features for Version 2
Version 2 builds on the proven V1 platform controls. The following is the agreed feature scope, covering multiple players, movement, world integration and cooperation with the other drivers. These are development plans, not a list of completed V2 features.
Multiple players and independent controls
- One to four simultaneous players, each with independent position, movement, animation and runtime state.
- Per-player configuration, replacing the single global player setup used in V1.
- Independent controls and input bindings for each player.
- Per-player input enable and disable, while physics and other player processing continue.
- Timed input lockout, with a timeout of
0keeping input disabled until the game explicitly enables it again.
Movement, ladders and landing
- Preserve all proven V1 movement: walking, sprinting, jumping, super-jumping, gravity, maximum fall speed, fall-height tracking and collision handling.
- Preserve and extend the ladder system: climbing, ladder sprinting, ladder catching and correct ladder-top landing behaviour.
- Configurable landing rebound or bounce, allowing a player to bounce automatically when landing.
- External impulses for one-off effects such as enemy knockback and explosions. playerControl applies the impulse and resolves the resulting movement and collisions.
- Persistent external forces, such as wind, water currents, magnetic fields and conveyors. The originating system owns the force; playerControl owns its effect on player movement.
Slopes, moving platforms and player collisions
- Slope support: scrollingControl supplies slope and terrain geometry, while playerControl uses it to resolve movement.
- Moving-platform cooperation: scrollingControl owns platform and world motion; playerControl incorporates that movement into the player’s final position.
- Optional player-to-player collision, limited to blocking. Pushing, carrying, stacking, momentum transfer and using another player as a moving platform are excluded.
World positions, boundaries and events
- World-coordinate player positioning, with a separate starting position for each player through
startWorldXandstartWorldY. - Per-player sprite offsets, using
spriteOffsetXandspriteOffsetYto relate the logical player position to the displayed sprite. - Per-player movement limits:
worldMinX,worldMaxX,worldMinYandworldMaxY. playerControl owns and enforces these boundaries. - World-boundary reporting:
EV_WORLD_BOUNDARYuses LEFT, RIGHT, TOP and BOTTOM flags to identify the edge reached. It fires when the player reaches the boundary, rather than every frame while held against it. - Player-aware events and state reports, identifying which of the players caused an event.
- Scrolling-system cooperation: playerControl uses the appropriate world and camera information from scrollingControl. Camera scrolling, terrain geometry, environmental systems and moving-platform logic remain owned by scrollingControl.
cameraX and cameraY are supplied by scrollingControl. playerControl consumes them where needed to position its players; it does not own camera movement.
Sprite magnification and video timing
- Independent horizontal and vertical hardware sprite magnification, where supported by the Next. Shrinking a sprite below its normal size is outside this feature.
- Continued 50 Hz support. Normalised physics and support for 60 Hz are being investigated for V2; they are not guaranteed until proved on hardware.
Clear responsibilities across the drivers
- Interoperability designed in from the start. Other drivers can supply information and forces, but playerControl retains responsibility for the final movement of its players.
- Safe operation alongside other drivers and NextZXOS. The implementation must accommodate multiple player instances without relying on V1’s single-player global state or self-modifying operands where those would interfere with other players or drivers.
- Lives, death and respawning stay with the game. BASIC continues to decide what those events mean for the adventure.
Outside the agreed V2 scope
8×8 sprite support has been dropped from V2. Player pushing, carrying, stacking and momentum transfer are also excluded, as is using another player as a moving platform. Hardware magnification does not provide genuine shrinking below the sprite’s normal size.
RPG / Interaction Support — planned for Version 2
V2 is intended to extend the proven movement system to top-down games, RPGs and adventures without turning playerControl into an RPG engine.
- Gravity can be disabled; jumping, falling, ladders and other platform-specific mechanics can be disabled independently, allowing straightforward four-direction movement.
- Generic detection of entering, leaving or overlapping designated interactive sprites or objects, including more than one nearby or overlapping object where appropriate.
- An action/interact button and interaction events that identify the player, object/entity and interaction type where appropriate.
playerControl reports the interaction; it does not decide its gameplay result. If Player 1 interacts with object 17, NextBASIC decides whether that object is a suitcase, drawer, NPC, chest, door or switch, and what happens.
These are agreed architectural plans, not implemented features or a finalised API. No new parameter numbers or binary layouts are assigned here.
Movement and gameplay ownership
playerControl owns player movement, physics, collision response and player-specific state. NextBASIC owns game structure, game rules and authoritative gameplay state, including lives, scoring, inventory, dialogue, quests, health and respawning rules. scrollingControl owns scrolling, camera behaviour, world geometry and environmental systems. External systems own their forces; playerControl resolves the resulting movement and collisions. Presentation/UI drivers may react to playerControl events, but playerControl does not implement gameplay presentation.