123456789101112131415161718192021222324252627282930313233 |
- /*
- * 2D Game Engine
- * Animation.h:
- * Based on pikuma.com 2D game engine in C++ and Lua course
- * Copyright (c) 2021 986-Studio. All rights reserved.
- *
- * Created by Manoël Trapier on 15/02/2021.
- */
- #ifndef GAMEENGINE_ANIMATION_H
- #define GAMEENGINE_ANIMATION_H
- #include <stdint.h>
- #include <SDL.h>
- struct AnimationComponent
- {
- uint32_t numFrames;
- uint32_t currentFrame;
- uint32_t frameSpeedRate;
- bool isLoop;
- uint32_t startTime;
- explicit AnimationComponent(uint32_t numFrames = 1, int frameSpeedRate = 1,
- bool isLoop = true) :numFrames(numFrames), frameSpeedRate(frameSpeedRate), isLoop(isLoop)
- {
- this->currentFrame = 1;
- this->startTime = SDL_GetTicks();
- };
- };
- #endif /* GAMEENGINE_ANIMATION_H */
|