Otter
0.9.8.91
2d Game Development Framework based on SFML.Net
|
A base class for Movement Components to extend. More...
Inherits Otter.Component.
Inherited by Otter.BasicMovement, and Otter.PlatformingMovement.
Public Member Functions | |
void | AddCollision (params int[] tags) |
Register a tag that the Collider should check for collisions with. More... | |
void | AddCollision (params Enum[] tags) |
Register a tag that the Collider should check for collisions with. More... | |
void | RemoveCollision (params int[] tags) |
Remove a tag from the collision checking. More... | |
virtual void | MoveX (int speed, Collider collider=null) |
Move the object in the X axis by the value of speed. Sweeping collision test. More... | |
virtual void | MoveY (int speed, Collider collider=null) |
Move the object in the Y axis by the value of speed. Sweeping collision test. More... | |
virtual void | MoveCollideX (Collider collider) |
Called when MoveX collides with a collider. More... | |
virtual void | MoveCollideY (Collider collider) |
Called when MoveY collides with a collider. More... | |
void | MoveXY (int speedX, int speedY, Collider collider=null) |
Shortcut to call both move x and move y. More... | |
Public Member Functions inherited from Otter.Component | |
T | GetEntity< T > () |
Get the Entity as a specific Type. More... | |
virtual void | Added () |
Called when the Component is added to the Entity. More... | |
virtual void | Removed () |
Called when the Component is removed from the Entity. More... | |
void | RemoveSelf () |
Removes the Component from its parent Entity. More... | |
virtual void | UpdateFirst () |
Called during the UpdateFirst on the parent Entity. More... | |
virtual void | Update () |
Called during the Update on the parent Entity. More... | |
virtual void | Render () |
Called during the Render on the parent Entity. More... | |
virtual void | UpdateLast () |
Called during the UpdateLast on the parent Entity. More... | |
T | GetComponent< T > () |
Gets the first Component of type T from this Component's Entity. More... | |
List< T > | GetComponents< T > () |
Gets a list of Components of type T from this Component's Entity. More... | |
Public Attributes | |
Action | OnMove |
An action triggered after movement as been applied. Up to subclasses to implement. More... | |
int | SpeedScale = 100 |
Determines how many units represent 1 pixel. Default is 100. Example: A speed of 100 would move the object 1 pixel per update. More... | |
new Collider | Collider |
The main Collider to use for detecting collisions. If this is not set, no collisions will register at all! More... | |
Action | OnCollideX |
An action triggered when there is a collision in the X axis. More... | |
Action | OnCollideY |
An action triggered when there is a collision in the Y axis. More... | |
Public Attributes inherited from Otter.Component | |
Entity | Entity |
The parent Entity of the Component. More... | |
bool | RenderAfterEntity = true |
Determines if the Component should render after the Entity has rendered. More... | |
bool | Visible = true |
Determines if the Component will render. More... | |
float | Timer = 0 |
How long the Component has been alive (added to an Entity and updated.) More... | |
Protected Attributes | |
int | MoveBufferX = 0 |
Properties | |
List< int > | CollisionsSolid [get, set] |
The list of types that the Collider should check for collisions for when moving. More... | |
Properties inherited from Otter.Component | |
int | InstanceId [get, set] |
The Component's id for the Entity its attached to. More... | |
Scene | Scene [get] |
The Scene that the parent Entity is in. More... | |
Collider | Collider [get] |
The first Collider of the parent Entity. More... | |
Graphic | Graphic [get] |
The first Graphic of the parent Entity. More... | |
List< Graphic > | Graphics [get] |
The list of Graphics from the parent Entity. More... | |
List< Collider > | Colliders [get] |
The list of Colliders from the parent Entity. More... | |
A base class for Movement Components to extend.
void Otter.Movement.AddCollision | ( | params int[] | tags | ) |
Register a tag that the Collider should check for collisions with.
tags | The tags to collide with. |
void Otter.Movement.AddCollision | ( | params Enum[] | tags | ) |
Register a tag that the Collider should check for collisions with.
tags | The tags to collide with. |
|
virtual |
Called when MoveX collides with a collider.
collider | The collider that was hit. |
Reimplemented in Otter.PlatformingMovement, and Otter.BasicMovement.
|
virtual |
Called when MoveY collides with a collider.
collider | The collider that was hit. |
Reimplemented in Otter.PlatformingMovement, and Otter.BasicMovement.
|
virtual |
Move the object in the X axis by the value of speed. Sweeping collision test.
speed | The speed to move by (remember SpeedScale is applied.) |
collider | The Collider to use when moving. |
void Otter.Movement.MoveXY | ( | int | speedX, |
int | speedY, | ||
Collider | collider = null |
||
) |
Shortcut to call both move x and move y.
speedX | |
speedY | |
collider |
|
virtual |
Move the object in the Y axis by the value of speed. Sweeping collision test.
speed | The speed to move by (remember SpeedScale is applied.) |
collider | The Collider to use when moving. |
Reimplemented in Otter.PlatformingMovement.
void Otter.Movement.RemoveCollision | ( | params int[] | tags | ) |
Remove a tag from the collision checking.
tags |
new Collider Otter.Movement.Collider |
The main Collider to use for detecting collisions. If this is not set, no collisions will register at all!
Action Otter.Movement.OnCollideX |
An action triggered when there is a collision in the X axis.
Action Otter.Movement.OnCollideY |
An action triggered when there is a collision in the Y axis.
Action Otter.Movement.OnMove |
An action triggered after movement as been applied. Up to subclasses to implement.
int Otter.Movement.SpeedScale = 100 |
Determines how many units represent 1 pixel. Default is 100. Example: A speed of 100 would move the object 1 pixel per update.
|
getset |
The list of types that the Collider should check for collisions for when moving.