import TopDownController from 'seed-engine/src/component/TopDownController.js'
TopDownController
Extends:
A Controller Component with extra methods designed for controlling a character in a Top-Down Perspective view.
Constructor Summary
Public Constructor | ||
public |
|
Method Summary
Public Methods | ||
public |
isDownPressed(): * Returns true if this game update notices a key press for 'S' or Down key. |
|
public |
isLeftPressed(): * Returns true if this game update notices a key press for 'A' or Left key. |
|
public |
isRightPressed(): * Returns true if this game update notices a key press for 'D' or Right key. |
|
public |
isUpPressed(): * Returns true if this game update notices a key press for 'W' or Up key. |
Inherited Summary
From class Updateable | ||
public |
deregister: * |
|
public |
|
|
public |
|
|
public |
id: * |
|
public |
Cleanup code for when destroying an Updateable. |
|
public |
end() Base call function for when this Updateable is to be ended. |
|
public |
onEnd() Called when the object is being removed or cleaned up from usage. |
|
public |
onPause() Called when the object is intended to be paused. |
|
public |
onStart() Called when the the object is first introduced. |
|
public |
Called when the object is to be unpaused from paused state. |
|
public |
onUpdate() Called on every update within the game, once the object has had onStart called. |
|
public |
pause() Base call function for when this Updateable is to be paused. |
|
public |
start() Base call function for when this Updateable is to be started. |
|
public |
unpause() Base call function for when this Updateable is to be unpaused. |
|
public |
update() Base call function for when this Updateable is to be updated. |
From class Component | ||
public |
|
|
public |
isUnique: * |
|
public |
Called when the component is successfully added to a GameObject. |
Public Constructors
public constructor() source
Constructor for Base Components. Requires a boolean to indicate if a GameObject can contain multiple components of this type.
Override:
Controller#constructorPublic Methods
public isDownPressed(): * source
Returns true if this game update notices a key press for 'S' or Down key.
Return:
* |
public isLeftPressed(): * source
Returns true if this game update notices a key press for 'A' or Left key.
Return:
* |
public isRightPressed(): * source
Returns true if this game update notices a key press for 'D' or Right key.
Return:
* |
public isUpPressed(): * source
Returns true if this game update notices a key press for 'W' or Up key.
Return:
* |