Added Sprite Coloring and Value Animations
This commit is contained in:
parent
e0e5298c81
commit
0cc5c0badf
11 changed files with 175 additions and 11 deletions
38
asloengine/headers/animation.hpp
Normal file
38
asloengine/headers/animation.hpp
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
#pragma once
|
||||
|
||||
#include <math.h>
|
||||
#include "helpers.hpp"
|
||||
|
||||
namespace asloengine
|
||||
{
|
||||
|
||||
class Animation
|
||||
{
|
||||
|
||||
public:
|
||||
enum Function
|
||||
{
|
||||
LINEAR, EASE_IN, EASE_OUT, EASE_IN_OUT
|
||||
};
|
||||
|
||||
Animation(Function _function, float _start_value, float _end_value, float _duration);
|
||||
|
||||
void reset(Function _function, float _start_value, float _end_value, float _duration);
|
||||
float animate(float delta_time);
|
||||
|
||||
protected:
|
||||
Function function;
|
||||
float start_value;
|
||||
float current_value;
|
||||
float end_value;
|
||||
float time;
|
||||
float duration;
|
||||
|
||||
float calculate_linear();
|
||||
float calculate_ease_in();
|
||||
float calculate_ease_out();
|
||||
float calculate_ease_in_out();
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue