-
Notifications
You must be signed in to change notification settings - Fork 0
/
kirby.h
40 lines (38 loc) · 1.03 KB
/
kirby.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
#include "gametool.h"
#include "load&free.h"
#ifndef Kirby_
#define Kirby_
enum Statetype{origin,sword,fire};
struct Kirby
{
float x=0;
float y=240;
char hp[2]={'5','\0'};
float jumpheight=100;
Statetype state=origin;
bool isWalkingRight=false;
bool isWalkingLeft=false;
bool isJumpingUp=false;
bool isJumpingDown=false;
bool isAttacking=false;
bool isRight=true;
bool gravity=true;
bool isGround=true;
bool godown=false;
};
struct Monster
{
float x=0;
float y=0;
int hp=0;
Statetype state=origin;
};
#endif // Kirby_
void Walk(Kirby *k , float x);
void JumpUp(Kirby *k );
bool JumpDown(Kirby *k );
bool Attack(Kirby *k,Monster *m,SDL_Surface *screen,SDL_Surface *images[]);
void kirby_hurt(Kirby *k,Monster *m,int *count);
void monster_in_stage(FILE *fp,Monster *fire_m,Monster *fire_m2,Monster *sword_m,Monster *sword_m2,int stage);
void monster_hurt(Kirby *k,Monster *m);
void monster_moves_by_itself(Monster *m,float *monster_distance);