GameKit
0.0.1a
C++ gamedev tools
include
gk
graphics
tilemap
TilemapAnimator.hpp
Go to the documentation of this file.
1
/*
2
* =====================================================================================
3
*
4
* Filename: TilemapAnimator.hpp
5
*
6
* Description:
7
*
8
* Created: 15/02/2019 19:20:31
9
*
10
* Author: Quentin Bazin, <quent42340@gmail.com>
11
*
12
* =====================================================================================
13
*/
14
#ifndef GK_TILEMAPANIMATOR_HPP_
15
#define GK_TILEMAPANIMATOR_HPP_
16
17
#include "
gk/core/Timer.hpp
"
18
#include "
gk/graphics/Tileset.hpp
"
19
20
namespace
gk
{
21
22
class
Tilemap;
23
24
class
TilemapAnimator
{
25
public
:
26
void
init
(
Tilemap
&map);
27
28
void
animateTiles
(
Tilemap
&map);
29
30
private
:
31
struct
TileAnimation
{
32
Timer
timer
;
33
u16
currentFrame
= 0;
34
};
35
36
std::vector<TileAnimation>
m_tileAnimations
;
37
};
38
39
}
// namespace gk
40
41
#endif // GK_TILEMAPANIMATOR_HPP_
gk::TilemapAnimator
Definition:
TilemapAnimator.hpp:24
gk::TilemapAnimator::m_tileAnimations
std::vector< TileAnimation > m_tileAnimations
Definition:
TilemapAnimator.hpp:36
gk
Definition:
AudioPlayer.hpp:21
gk::TilemapAnimator::TileAnimation::timer
Timer timer
Definition:
TilemapAnimator.hpp:32
u16
unsigned short u16
Definition:
IntTypes.hpp:22
gk::TilemapAnimator::init
void init(Tilemap &map)
Definition:
TilemapAnimator.cpp:19
gk::TilemapAnimator::TileAnimation
Definition:
TilemapAnimator.hpp:31
Tileset.hpp
gk::Tilemap
Definition:
Tilemap.hpp:24
gk::Timer
Very basic timer.
Definition:
Timer.hpp:25
gk::TilemapAnimator::TileAnimation::currentFrame
u16 currentFrame
Definition:
TilemapAnimator.hpp:33
Timer.hpp
gk::TilemapAnimator::animateTiles
void animateTiles(Tilemap &map)
Definition:
TilemapAnimator.cpp:23
Generated by
1.8.12