Raylib Bubbles
C++11 Raylib bubble shooter game.
|
Represents the state of an object to be animated. More...
#include <action.hpp>
Public Types | |
enum class | AnimType { BUBBLE , BUBBLE_GLOW , PARTICLE } |
Selects the type of object being animated, to later determine what to draw. More... | |
Public Member Functions | |
AnimState (const float x, const float y, const float xVel, const float yVel, const AnimType type, const size_t hue, const ssize_t duration, const bool hasGravity) | |
Constructs an animation state with the given data. More... | |
Static Public Member Functions | |
Alternative constructors for common animations. | |
static AnimState | bubble (const float x, const float y, const float xVel, const float yVel, const size_t hue) |
static AnimState | gravityBubble (const float x, const float y, const float xVel, const float yVel, const size_t hue) |
static AnimState | particle (const float x, const float y, const float xVel, const float yVel, const ssize_t duration) |
static AnimState | gravityParticle (const float x, const float y, const float xVel, const float yVel, const ssize_t duration) |
Public Attributes | |
size_t | hue |
ssize_t | duration |
AnimType | type |
float | x |
float | y |
float | xVel |
float | yVel |
bool | hasGravity |
Represents the state of an object to be animated.
This struct is used to represent the state of an object to be animated, such as a bubble or particle. It lays out multiple parameters that are essential to animating an object, as well as cleanly describing how to make the objects behave, such as applying gravity or setting a duration in frames.
|
strong |
Selects the type of object being animated, to later determine what to draw.
|
inline |
Constructs an animation state with the given data.
x | The x coordinate of the object. |
y | The y coordinate of the object. |
xVel | The velocity of the object in the x axis. |
yVel | The velocity of the object in the y axis. |
type | The type of object being animated. |
hue | The hue of the object, for drawing purposes. |
duration | The duration of the animation, in steps. -1 disables the check. (ssize_t). |