Super awesome twitchy animation for axe guy.

This commit is contained in:
Zed A. Shaw 2025-02-22 11:03:38 -05:00
parent 80a0f2ba75
commit 83df9ff03b
10 changed files with 42 additions and 68 deletions

View file

@ -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);