Air-Trap 1.0.0
A multiplayer R-Type clone game engine built with C++23 and ECS architecture
Loading...
Searching...
No Matches
Animation.hpp
Go to the documentation of this file.
1/*
2** EPITECH PROJECT, 2025
3** Air-Trap
4** File description:
5** Animation
6*/
7
8#pragma once
9
10#include <SFML/Graphics/Rect.hpp>
11
12namespace rtp::ecs::components {
17struct Animation {
18 int totalFrames{1};
19 int currentFrame{0};
20 float frameDuration{0.1f};
21 bool loop{true};
22 float elapsedTime{0.0f};
23 int frameLeft{0};
24 int frameTop{0};
25 int frameWidth{0};
26 int frameHeight{0};
27};
28} // namespace rtp::ecs::components
File : Ammo.hpp License: MIT Author : Elias Josué HAJJAR LLAUQUEN elias-josue.hajjar-llauquen@epitech...
Definition Ammo.hpp:13
Component representing an animation.
Definition Animation.hpp:17
int frameWidth
Width of the current frame.
Definition Animation.hpp:25
bool loop
Whether the animation should loop.
Definition Animation.hpp:21
float elapsedTime
Time elapsed since the animation started.
Definition Animation.hpp:22
int frameHeight
Height of the current frame.
Definition Animation.hpp:26
int frameTop
Top position of the current frame.
Definition Animation.hpp:24
int totalFrames
Total frames including all animations.
Definition Animation.hpp:18
float frameDuration
Duration of each frame in seconds.
Definition Animation.hpp:20
int frameLeft
Left position of the current frame.
Definition Animation.hpp:23
int currentFrame
Index of the currently displayed frame (0 to totalFrames - 1)
Definition Animation.hpp:19