Systems and Components
The main system for controlling gameplay is the
GameplaySystem. It is responsible for controlling the gameplay loop (waiting, start, progress, finished), player spawn, AI spawn, calculation of race positions and checkpoint passing.
Gameplay component triggers
VehicleSystem is in charge of updates to the car physics components - specifically,
Steering - as well as checking for vehicle collisions and triggering the
VehicleCollision event which results in visual spark effects on the Unity side.
Vehicle component is responsible for applying physics forces to the car entity and solving wheel ground collisions. The
Steering component on the other hand is responsible forthe car rotation based on the steering input.
PlayerSystem updates the
Player component prepares
InputDesires, processes the checkpoint passing, periodically checks an entity’s driving line position (used for AI and race positions) and is holding the player states (
Finished). It also handles the vehicle resetting back to the track. The
Player component is added directly to the car entity.
When a checkpoint is passed, the
Player component triggers the
PickupSystem updates the pickups in the world (Nitro) and is responsible for checking if a player is passing through a pickup.