@fibbojs / 2d / FCharacterControllerK
Class: abstract
FCharacterControllerK
An abstract pre-defined character controller based on Kinematic rigidbodies.
Extends
Extended by
Constructors
new FCharacterControllerK()
new FCharacterControllerK(
scene
,options
):FCharacterControllerK
Parameters
• scene: FScene
• options: FCharacterControllerOptions
Returns
Overrides
FCharacterController
.constructor
Defined in
2d/src/controllers/FCharacterControllerK.ts:22
Methods
frame()
abstract
frame(delta
):void
Update the controller. Should be called every frame. The purpose of this method is to update the component transform based on the controller logic.
Parameters
• delta: number
The time since the last frame.
Returns
void
Inherited from
Defined in
core/dist/index.d.ts:26
getCorrectedMovements()
getCorrectedMovements():
object
Return the corrected movements for the current frame.
Returns
object
x
x:
number
y
y:
number
Defined in
2d/src/controllers/FCharacterControllerK.ts:44
Properties
characterController
characterController:
KinematicCharacterController
The character controller that will be used to move the character.
Defined in
2d/src/controllers/FCharacterControllerK.ts:20
component
component:
FComponent
The component attached to the controller. It is redefined here to get the correct type (with 2D properties).
Inherited from
FCharacterController
.component
Defined in
2d/src/controllers/FController.ts:17
inputs
inputs:
object
The inputs that will be used to move the character.
down
down:
boolean
left
left:
boolean
right
right:
boolean
up
up:
boolean
Inherited from
Defined in
2d/src/controllers/FCharacterController.ts:21
scene
scene:
FScene
The scene where the character is.
Inherited from
Defined in
2d/src/controllers/FCharacterController.ts:36
speed
speed:
number
The speed of the character.
Inherited from
Defined in
2d/src/controllers/FCharacterController.ts:31
yVelocity
yVelocity:
number
The y velocity of the character. Used to simulate gravity.