generated from 32blit/32blit-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlayer.hpp
56 lines (48 loc) · 1.23 KB
/
Player.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
* Player.hpp - part of SokoBlit
*
* Copyright (c) 2021 Pete Favelle / fsqaured limited <[email protected]>
*
* The Player class handles the player on an individual level. This is where
* we work out things like animations, position and suchlike.
*
* This software is distributed under the MIT License. See LICENSE for details.
*/
#ifndef _PLAYER_HPP_
#define _PLAYER_HPP_
#include "32blit.hpp"
#include "sokoblit.hpp"
#define ANIMATION_FRAMES 3
typedef enum
{
DIR_NONE,
DIR_DOWN,
DIR_LEFT,
DIR_UP,
DIR_RIGHT
} direction_t;
class Player
{
private:
blit::Point c_location;
direction_t c_direction;
uint8_t c_animation;
uint8_t c_steps;
bool c_blocked;
bool c_pushing;
uint16_t c_moves;
uint32_t c_deciseconds;
blit::Font *c_font;
public:
Player( uint16_t, uint16_t );
~Player( void );
bool moving( void );
bool pushing( void );
void render( void );
void update( void );
blit::Point location( void );
direction_t facing( void );
void move( direction_t, bool, bool );
};
#endif /* _PLAYER_HPP_ */
/* End of file Player.hpp */