#ifndef SPRITE_H_70503825 #define SPRITE_H_70503825 #include #include #include #include #include "direction.h" #include "renderer.h" #include "vector.h" #include "step_type.h" struct SpriteFrame { SDL_Rect srcRect; vec2i center; vec2i size; }; enum class CharacterState { Still, Walking, Crouching, Running }; struct Movement { vec2i pos; Direction dir; }; class Sprite { public: // Transform vec2i loc { 0, 0 }; bool collidable = false; vec2i collisionOffset; vec2i collisionSize; // Animation bool isAnimated = false; int textureId; Direction dir = Direction::down; std::string animationName; int animationId = 0; int animationFrame = 0; std::vector frames; std::vector> animations; std::map> nameDirToAnim; // Character bool orientable = false; std::vector followers; std::deque trail; CharacterState characterState = CharacterState::Still; StepType stepType = StepType::none; int runningSfxChannel = -1; // Input bool controllable = false; }; #endif /* end of include guard: SPRITE_H_70503825 */