generated from 32blit/32blit-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
player.hpp
56 lines (43 loc) · 1.48 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 Possum, a Space Shooter game. *|
|* *|
|* Copyright (C) 2021 Pete Favelle <[email protected]> *|
|* *|
|* This file is released under the MIT License; see LICENSE for details. *|
|* *|
|* The Player class encapsulates the whole player; his ship, lives, scores. *|
|* *|
\****************************************************************************/
#ifndef _PLAYER_HPP_
#define _PLAYER_HPP_
/* Constants and enums. */
typedef enum
{
BANK_LEFT,
BANK_NONE,
BANK_RIGHT
} ship_bank_t;
typedef enum
{
THRUST_NONE,
THRUST_CRUISE,
THRUST_BOOST
} ship_thrust_t;
/* Structures. */
class Player {
private:
uint32_t c_last_tick;
blit::Point c_position;
ship_bank_t c_bank;
ship_thrust_t c_thrust;
uint8_t c_thrust_frame;
uint32_t c_thrust_tick;
public:
Player( void );
~Player( void );
void update( uint32_t );
void render( void );
};
#endif /* _PLAYER_HPP_ */
/* End of file player.hpp */