Revision 202
bullet begins
proj/src/proj.c | ||
---|---|---|
23 | 23 |
#include "shooter.h" |
24 | 24 |
#include "pistol.h" |
25 | 25 |
#include "nothing.h" |
26 |
#include "bullet.h" |
|
26 | 27 |
|
27 | 28 |
int main(int argc, char* argv[]) { |
28 | 29 |
|
... | ... | |
117 | 118 |
gunner_t *shooter2 = gunner_ctor(bsp_shooter, bsp_nothing); |
118 | 119 |
gunner_set_pos(shooter2, -50, -50); |
119 | 120 |
|
121 |
ent_t *bullet = ent_ctor(get_bullet(), bsp_nothing); |
|
122 |
ent_set_pos(bullet, 400, 400); |
|
123 |
|
|
120 | 124 |
graph_clear_screen(); |
121 | 125 |
gunner_draw(shooter1); |
122 | 126 |
sprite_draw(sp_crosshair); |
... | ... | |
161 | 165 |
graph_clear_screen(); |
162 | 166 |
gunner_draw(shooter2); |
163 | 167 |
gunner_draw(shooter1); |
168 |
ent_draw(bullet); |
|
164 | 169 |
sprite_draw(sp_crosshair); |
165 | 170 |
graph_draw(); |
166 | 171 |
} |
proj/xpm/bullet.h | ||
---|---|---|
1 |
#include "bullet.xpm" |
|
2 |
#include "sprite.h" |
|
3 |
|
|
4 |
basic_sprite_t* get_bullet(void){ |
|
5 |
return basic_sprite_ctor((const char **)bullet_xpm, 3, 7); |
|
6 |
} |
|
0 | 7 |
Also available in: Unified diff