Revision 201
renamed gunner
proj.c | ||
---|---|---|
109 | 109 |
#ifdef TELMO |
110 | 110 |
ent_set_scale(2.0); |
111 | 111 |
|
112 |
ent_t *shooter1 = ent_ctor(bsp_shooter, bsp_pistol); if(shooter1 == NULL) printf("Failed to get shooter1\n");
|
|
113 |
ent_set_pos(shooter1, 0, 0);
|
|
114 |
ent_set_origin(ent_get_x(shooter1)-ent_get_XLength()/2.0,
|
|
115 |
ent_get_y(shooter1)-ent_get_YLength()/2.0);
|
|
112 |
gunner_t *shooter1 = gunner_ctor(bsp_shooter, bsp_pistol); if(shooter1 == NULL) printf("Failed to get shooter1\n");
|
|
113 |
gunner_set_pos(shooter1, 0, 0);
|
|
114 |
ent_set_origin(gunner_get_x(shooter1)-ent_get_XLength()/2.0,
|
|
115 |
gunner_get_y(shooter1)-ent_get_YLength()/2.0);
|
|
116 | 116 |
|
117 |
ent_t *shooter2 = ent_ctor(bsp_shooter, bsp_nothing);
|
|
118 |
ent_set_pos(shooter2, -50, -50);
|
|
117 |
gunner_t *shooter2 = gunner_ctor(bsp_shooter, bsp_nothing);
|
|
118 |
gunner_set_pos(shooter2, -50, -50);
|
|
119 | 119 |
|
120 | 120 |
graph_clear_screen(); |
121 |
ent_draw(shooter1);
|
|
121 |
gunner_draw(shooter1);
|
|
122 | 122 |
sprite_draw(sp_crosshair); |
123 | 123 |
graph_draw(); |
124 | 124 |
|
... | ... | |
152 | 152 |
if (no_interrupts % refresh_count_value == 0) { |
153 | 153 |
update_movement(shooter1); |
154 | 154 |
update_scale(); |
155 |
ent_set_origin(ent_get_x(shooter1)-ent_get_XLength()/2.0,
|
|
156 |
ent_get_y(shooter1)-ent_get_YLength()/2.0);
|
|
155 |
ent_set_origin(gunner_get_x(shooter1)-ent_get_XLength()/2.0,
|
|
156 |
gunner_get_y(shooter1)-ent_get_YLength()/2.0);
|
|
157 | 157 |
|
158 | 158 |
sprite_set_pos(sp_crosshair, get_mouse_X(), get_mouse_Y()); |
159 | 159 |
double angle = get_mouse_angle(shooter1); |
160 |
ent_set_angle(shooter1, angle - M_PI_2);
|
|
160 |
gunner_set_angle(shooter1, angle - M_PI_2);
|
|
161 | 161 |
graph_clear_screen(); |
162 |
ent_draw(shooter2);
|
|
163 |
ent_draw(shooter1);
|
|
162 |
gunner_draw(shooter2);
|
|
163 |
gunner_draw(shooter1);
|
|
164 | 164 |
sprite_draw(sp_crosshair); |
165 | 165 |
graph_draw(); |
166 | 166 |
} |
... | ... | |
187 | 187 |
} |
188 | 188 |
|
189 | 189 |
#ifdef TELMO |
190 |
ent_dtor(shooter1); shooter1 = NULL;
|
|
190 |
gunner_dtor(shooter1); shooter1 = NULL;
|
|
191 | 191 |
#endif |
192 | 192 |
|
193 | 193 |
basic_sprite_dtor(bsp_crosshair); bsp_crosshair = NULL; |
Also available in: Unified diff