Added Sprite Coloring and Value Animations

This commit is contained in:
Aslan2142 2019-09-06 11:45:24 +02:00
parent e0e5298c81
commit 0cc5c0badf
11 changed files with 175 additions and 11 deletions

View 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();
};
}