-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathobject.h
More file actions
47 lines (39 loc) · 689 Bytes
/
object.h
File metadata and controls
47 lines (39 loc) · 689 Bytes
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
#ifndef OBJECT_H
#define OBJECT_H
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include <string>
class Game;
enum class ObjectType
{
OBJ_GENERIC,
OBJ_PLAYER1,
OBJ_PLAYER2,
OBJ_ENEMY_SLIDER,
OBJ_PLAYER_BEAM,
OBJ_ENEMY_BEAM,
OBJ_LEVEL = 0xFE,
OBJ_UNKNOWN = 0xFF
};
class Object
{
protected:
bool alive;
bool fx_blink;
bool fx_fliph;
bool fx_flipv;
bool visible;
Game *game;
int h;
int w;
int x;
int y;
SDL_Texture *sprite;
public:
ObjectType type;
void Draw();
void Kill();
Object(Game *Pgame, char texture_path[], bool is_visible, int pos_x, int pos_y);
virtual void Tick() = 0;
};
#endif // OBJECT_H