Nymph Game Engine
Chaiscript based Game Engine
|
#include <sprite_movement.h>
Classes | |
class | FaceDownReactor |
class | FaceLeftReactor |
class | FaceRightReactor |
class | FaceUpReactor |
class | MoveDownReactor |
class | MoveLeftReactor |
class | MoveRightReactor |
class | MoveUpReactor |
struct | SpriteData |
Sprite data to be exposed for FSM mutation. More... | |
Public Types | |
enum | SpriteState : unsigned int { MOVE_UP, FACE_UP, MOVE_DOWN, FACE_DOWN, MOVE_LEFT, FACE_LEFT, MOVE_RIGHT, FACE_RIGHT } |
Sprite state enum. More... | |
enum | SpriteInput : unsigned int { LEFT, RIGHT, UP, DOWN, NONE } |
Sprite input enum. More... | |
using | SpriteFSM = Events::FSM::FSM< SpriteData, SpriteState, SpriteInput, MoveUpReactor, FaceUpReactor, MoveDownReactor, FaceDownReactor, MoveLeftReactor, FaceLeftReactor, MoveRightReactor, FaceRightReactor > |
Static Public Member Functions | |
static std::shared_ptr < SpriteData > | defaultSpriteData () |
Create a default SpriteData POD. More... | |
static bool | updateSprite (const std::shared_ptr< SpriteData > data, const SpriteState current_state, const double delta) |
General sprite update for each reactor. More... | |
enum Game::SpriteMovementMotor::SpriteInput : unsigned int |
enum Game::SpriteMovementMotor::SpriteState : unsigned int |
|
inlinestatic |
Create a default SpriteData POD.
|
inlinestatic |
General sprite update for each reactor.
[in] | data | Sprite data |
[in] | current_state | The current sprite state |
[in] | delta | The update delta |
References MOVE_DOWN, MOVE_LEFT, MOVE_RIGHT, and MOVE_UP.
Referenced by Game::SpriteMovementMotor::MoveUpReactor::updateState(), Game::SpriteMovementMotor::MoveDownReactor::updateState(), Game::SpriteMovementMotor::MoveLeftReactor::updateState(), and Game::SpriteMovementMotor::MoveRightReactor::updateState().