PlatformerControlsWrapper class
This class implements traditional platformer controls, with support for jumping, running, etc
the controls use keyboard keys W, A, S, D or Arrow keys for movement, and SPACE for jumping;
The meaning of object
& target
options is intepreted as follows:
-
The
object
is moved by the controls actions -
The
target
is used to determine the forward direction of the movement
The behavior of the controls can be customized using the params object. See PlatformerControlsWrapperParams for more info
Signature:
export declare class PlatformerControlsWrapper extends ControlsAbstract
Extends: ControlsAbstract
Remarks
The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the PlatformerControlsWrapper
class.
Properties
Property |
Modifiers |
Type |
Description |
---|---|---|---|
The actions influence the movement of the attached object. Those are typically set automtically from the user input. If you deactivate the controls's controller, you can set those manually to control the movement of the attached object | |||
boolean |
whether the controls are active | ||
boolean |
When true, the controls will automatically set the forward direction of the movement based on the target object's rotation. Default is true. | ||
CollisionInfo[] |
a list of objects that the attached object is colliding with in the current frame | ||
The controller handles the input events and sets the corresponding actions | |||
boolean |
Indicates whether the attached object is currently jumping | ||
boolean |
Indicates whether the attached object is currently moving (walking, jumping, etc) | ||
boolean |
Indicates whether the attached object is colliding with a ground collider (like a terrain) |
Methods
Method |
Modifiers |
Description |
---|---|---|