Class SpriteMovementController
Represents a behavior for controlling the movement of a sprite.
Inherited Members
Namespace: Genesis.Core.Behaviors
Assembly: Genesis.dll
Syntax
public class SpriteMovementController : IGameBehavior
Constructors
SpriteMovementController()
Initializes a new instance of the SpriteMovementController class.
Declaration
public SpriteMovementController()
Properties
Automove
Gets or sets a flag indicating whether automatic movement is enabled.
Declaration
public bool Automove { get; set; }
Property Value
Type | Description |
---|---|
bool |
MoveSpeed
Gets or sets the speed of the sprite movement.
Declaration
public float MoveSpeed { get; set; }
Property Value
Type | Description |
---|---|
float |
Methods
MoveDown()
Moves the sprite downwards.
Declaration
public void MoveDown()
MoveLeft()
Moves the sprite to the left.
Declaration
public void MoveLeft()
MoveRight()
Moves the sprite to the right.
Declaration
public void MoveRight()
MoveUp()
Moves the sprite upwards.
Declaration
public void MoveUp()
OnDestroy(Game, GameElement)
Called when the behavior is destroyed.
Declaration
public override void OnDestroy(Game game, GameElement parent)
Parameters
Type | Name | Description |
---|---|---|
Game | game | |
GameElement | parent |
Overrides
OnInit(Game, GameElement)
Called when the behavior is initialized.
Declaration
public override void OnInit(Game game, GameElement parent)
Parameters
Type | Name | Description |
---|---|---|
Game | game | |
GameElement | parent |
Overrides
OnRender(Game, GameElement)
Called during the rendering phase.
Declaration
public override void OnRender(Game game, GameElement parent)
Parameters
Type | Name | Description |
---|---|---|
Game | game | |
GameElement | parent |
Overrides
OnUpdate(Game, GameElement)
Called during the update phase.
Declaration
public override void OnUpdate(Game game, GameElement parent)
Parameters
Type | Name | Description |
---|---|---|
Game | game | |
GameElement | parent |