Super awesome twitchy animation for axe guy.
This commit is contained in:
parent
80a0f2ba75
commit
83df9ff03b
10 changed files with 42 additions and 68 deletions
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
#include "dinkyecs.hpp"
|
||||
#include "components.hpp"
|
||||
#include "constants.hpp"
|
||||
#include "config.hpp"
|
||||
#include "dinky_components.hpp"
|
||||
#include "point.hpp"
|
||||
|
@ -89,17 +90,13 @@ namespace components {
|
|||
float scale = 0.0f;
|
||||
bool simple = true;
|
||||
int frames = 10;
|
||||
float speed = 0.3f;
|
||||
int current = 0;
|
||||
bool playing = false;
|
||||
float subframe = 0;
|
||||
|
||||
void step(sf::Vector2f& scale_out, sf::IntRect& rect_out) {
|
||||
if(current < frames) {
|
||||
scale_out.x += scale;
|
||||
scale_out.y += scale;
|
||||
current++;
|
||||
}
|
||||
|
||||
(void) rect_out;
|
||||
}
|
||||
void play();
|
||||
void step(sf::Vector2f& scale_out, sf::IntRect& rect_out);
|
||||
};
|
||||
|
||||
void configure(ComponentMap& component_map);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue