File: player.h

package info (click to toggle)
ketm 0.0.6-17sarge1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 9,356 kB
  • ctags: 875
  • sloc: ansic: 7,303; sh: 410; makefile: 185
file content (139 lines) | stat: -rw-r--r-- 2,460 bytes parent folder | download
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#ifndef _PLAYER_H_
#define _PLAYER_H_
#include <SDL/SDL.h>
#include <math.h>

#include "support.h"
#include "sprite.h"
#include "particle.h"
#include "enemy.h"

enum _player_state { PL_NORMAL, PL_EXPLODE, PL_SAVE };

typedef struct {
	int lives;
	int score;
	int level;
	int bossmode;
	int state;
	int explode;
	double save_delay;
	double anim_delay;
	int weapon;
	int player_speed;
	int extra;
	double extra_wait;
	double extra_time;
	double weapon_wait;
} PLAYER_DATA;

enum _weapon_type {
	WP_PLASMA=0,
	WP_DOUBLEPLASMA,
	WP_QUADPLASMA,
	WP_FIREBALL,
	WP_DOUBLEFIREBALL,
	WP_QUADFIREBALL,
	WP_KILLRAY,
	WP_LAST
};

enum _player_extras {
	PLX_NONE=0,
	PLX_HOMING,
	PLX_SHIELD,
	PLX_HLASER,
	PLX_LAST
};

typedef struct {
	int strength;
} WEAPON_BASE;

typedef struct {
	int strength;
	int angle;
	double speed;
} PL_PLASMA_DATA;

typedef struct {
	int strength;
	int angle;
	double speed;
} PL_FIREBALL_DATA;

typedef struct {
	int strength;
	int angle;
	double speed;
	double dist;
} PL_KILLRAY_DATA;

typedef struct {
	int strength;
	int angle;
	double speed;
} PL_BOMB_DATA;

typedef struct {
	int strength;
	int nr;
	int state;
	double angle;
	double range;
	double speed;
	/** @dia:route 0,2;h,7,7,-3,8,3 */
	SPRITE *tgsprite;
	int target_id;
} PL_HOMING_DATA;

typedef struct {
	double angle;
	int rad;
	double speed;
} PL_SHIELD_DATA;

typedef struct {
	int strength;
	int nr;
	int state;
	double angle;
	double range;
	double speed;
	int target_id;
} PL_HLASER_DATA;

void player_init();
void player_move(SPRITE *s);
void player_keycontrol(SPRITE *s);
void player_colcheck(SPRITE *s, int mask);

void player_add_fireball(SPRITE *player);
void player_add_doublefireball(SPRITE *player);
void player_add_quadfireball(SPRITE *player);
void player_move_fireball(SPRITE *s);

void player_add_plasma(SPRITE *player);
void player_add_doubleplasma(SPRITE *player);
void player_add_quadplasma(SPRITE *player);
void player_move_plasma(SPRITE *s);

void player_add_killray(SPRITE *player);
void player_move_killray(SPRITE *s);

void player_add_bomb(SPRITE *s);
void player_move_bomb(SPRITE *s);

void player_add_homing(SPRITE *s);
void player_move_homing(SPRITE *s);
int search_enemy();

void player_add_shield(SPRITE *s);
void player_move_shield(SPRITE *s);

void player_add_hlaser(SPRITE *s);
void player_controller_hlaser(CONTROLLER *c);
void player_move_hlaser(SPRITE *s);

void weapon_colcheck(SPRITE *s, int angle, int destroy, int check_bullets);
#endif