forked from tako2/galaxion
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathship.h
48 lines (35 loc) · 839 Bytes
/
ship.h
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
//
//
//
#ifndef _SHIP_H
#define _SHIP_H
#include "Arduboy.h"
#include "common.h"
//=============================================================================
typedef enum {
SHIP_ST_NONE,
SHIP_ST_READY,
SHIP_ST_SHOOTING,
SHIP_ST_EXPLODED,
SHIP_ST_LOST
} eShipState;
//=============================================================================
class Ship {
public:
Position pos;
eShipState state = SHIP_ST_NONE;
int pat;
int dont_shoot;
Position *missile;
Ship() { missile = NULL; };
~Ship() {};
void init();
void explode();
void check_input(int frame);
void do_state(int frame);
void draw(int frame);
void cancel_missile();
bool is_alive();
};
#endif // !_SHIP_H
//================================ END-OF-FILE ================================