Input
Available in the Gaming Circle and Industries Circle
Overview
The Side Scrolling Runner sample only uses Quantum's Input struct for all of its input, so there were no Commands used in this sample.
Unity
Find the simple input polling in LocalInput.cs
, where it uses Unity's Input API.
The game controls are defined as follow:
- Press
Space Bar
to perform a short jump; - Press and hold
Space Bar
to perform a long jump; - Press
Left Shift
to use gadgets.
Quantum
There are three booleans in the Input struct which are packed into a single byte:
- JumpStart;
- JumpHold;
- Attack.
The input is processed using the helper structs MovementDesires
and GadgetDesires
. Desires are filled based on the player’s input polled from Unity; they could also be replaced by generated Input for AI (not implemented in this sample).