-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathvaisseau_data.h
executable file
·85 lines (65 loc) · 1.82 KB
/
vaisseau_data.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#ifndef __VAISSEAU_DATA_H__
#define __VAISSEAU_DATA_H__
#include <allegro.h>
#include "vaisseau_gfx.h"
#define MAX_TIR 20
struct debris_data {
int x, y;
fixed xposprecise,yposprecise;
fixed ax, ay;
fixed vx, vy;
fixed impultion;
int angle;
bool active;
};
struct tir_data {
int x, y;
fixed xposprecise, yposprecise;
fixed dx, dy;
bool free;
};
struct vaisseau_data {
// special for each ship
fixed mass;
fixed thrust_max;
int anglestep;
int fuel;
int shield_force;
int max_fuel;
int speed_fuel_down;
int speed_fuel_up;
bool refueling;
int max_shield_force;
int speed_shield_force_down;
int speed_shield_force_up;
int explode_count;
bool explode;
int option_type;
int impactx,impacty;
fixed ax,ay;
fixed vx,vy;
fixed xposprecise,yposprecise;
int xpos,ypos;
int angle;
fixed thrust;
bool shield;
bool fire;
bool fire_delay;
bool landed;
bool rebound;
BITMAP *sprite_buffer; // Image du vaisseau
BITMAP *sprite_buffer_rota;
struct vaisseau_gfx * gfx;
struct tir_data tir[MAX_TIR];
struct tir_data backtir[MAX_TIR];
struct debris_data debris[8]; // 8 debris
};
int init_vaisseau_data(struct vaisseau_data* v, struct vaisseau_gfx* gfx,
float mass, float thrust_max, int anglestep,
int max_fuel, int speed_fuel_down, int speed_fuel_up,
int max_shield_force, int speed_shield_force_down, int speed_shield_force_up);
void clean_vaisseau_data(struct vaisseau_data* v);
void init_ship_pos_from_platforms(struct vaisseau_data* v, struct platform_data * plats);
// to be called at each vbl!
void fuel_shield_calcul(int nbvaisseau, struct vaisseau_data *v);
#endif