-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcBicho.h
61 lines (45 loc) · 1022 Bytes
/
cBicho.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
49
50
51
52
53
54
55
56
57
58
59
60
61
#pragma once
#include "cTexture.h"
#include "utils.h"
#define FRAME_DELAY 4
#define FRAME_DELAY_WALK 10
#define STEP_LENGTH 4
#define STATE_IDLE 1
#define STATE_MOVE 0
#define STATE_ATTACK_1 2
#define STATE_ATTACK_2 3
#define STATE_SWORD 4
class cBicho
{
public:
cBicho(void);
cBicho(int x,int y,int w,int h);
~cBicho(void);
void SetPosition(int x,int y);
void GetPosition(int *x,int *y);
void SetBlock(int tx,int ty);
void GetBlock(int *tx,int *ty);
void SetWidthHeight(int w,int h);
void GetWidthHeight(int *w,int *h);
bool Collides(cRect *rc);
void GetArea(cRect *rc);
void SetArea(cRect rc);
void DrawRect(int tex_id,float xo,float yo,float xf,float yf);
int GetState();
void SetState(int s);
int GetDirection();
void SetDirection(int s);
void NextFrame(int init,int max,int frame_delay);
int GetSpeed();
void SetSpeed(int s);
bool isAlive();
void setAlive(bool alive);
private:
int x,y;
int w,h;
int direction;
int state;
int speed;
int delay;
bool alive;
};