Revision 184
movement semi-implemented; missing structure
proj.c | ||
---|---|---|
22 | 22 |
|
23 | 23 |
#ifdef TELMO |
24 | 24 |
#include "crosshair.h" |
25 |
#include "shooter.h" |
|
25 | 26 |
#endif |
26 | 27 |
|
27 | 28 |
int main(int argc, char* argv[]) { |
... | ... | |
116 | 117 |
|
117 | 118 |
#ifdef TELMO |
118 | 119 |
sprite_t *crosshair = get_crosshair(); |
120 |
sprite_t *shooter1 = get_shooter(); |
|
121 |
sprite_set_pos(shooter1, 100, 100); |
|
119 | 122 |
graph_clear_screen(); |
120 | 123 |
sprite_draw(crosshair); |
124 |
sprite_draw(shooter1); |
|
121 | 125 |
graph_draw(); |
122 | 126 |
#endif |
123 | 127 |
|
... | ... | |
144 | 148 |
interrupt_handler(i); |
145 | 149 |
if ((scancode[0]) == ESC_BREAK_CODE) good = 0; |
146 | 150 |
#ifdef TELMO |
151 |
update_movement(shooter1); |
|
152 |
printf("POS: %d %d\n", sprite_get_x(shooter1), sprite_get_y(shooter1)); |
|
147 | 153 |
if (counter_mouse_ih >= 3) { |
148 | 154 |
struct packet pp = mouse_parse_packet(packet_mouse_ih); |
149 | 155 |
update_mouse_position(&pp); |
150 |
sprite_set_pos(crosshair, get_mouse_X(), get_mouse_Y()); |
|
151 | 156 |
printf("X: %d | Y: %d | XRES: %d | YRES: %d\n", get_mouse_X(), get_mouse_Y(), graph_get_XRes(), graph_get_YRes()); |
157 |
counter_mouse_ih = 0; |
|
158 |
} |
|
159 |
|
|
160 |
sprite_set_pos(crosshair, get_mouse_X(), get_mouse_Y()); |
|
161 |
double angle = get_mouse_angle(shooter1); |
|
162 |
sprite_set_angle(shooter1, angle); |
|
152 | 163 |
graph_clear_screen(); |
153 | 164 |
sprite_draw(crosshair); |
165 |
sprite_draw(shooter1); |
|
154 | 166 |
graph_draw(); |
155 |
counter_mouse_ih = 0; |
|
156 |
} |
|
157 | 167 |
#endif |
158 | 168 |
} |
159 | 169 |
} |
Also available in: Unified diff