Revision 225
more fluent movement
proj/src/proj_func.c | ||
---|---|---|
54 | 54 |
static const int speed = 5; |
55 | 55 |
double x = gunner_get_x(p); |
56 | 56 |
double y = gunner_get_y(p); |
57 |
gunner_set_pos(p, x + speed * hor_mov, y + speed * ver_mov);
|
|
57 |
gunner_set_pos(p, x + speed * hor_mov, y); |
|
58 | 58 |
if (map_collides_gunner(map, p)) { |
59 | 59 |
gunner_set_pos(p, x, y); |
60 | 60 |
} |
61 |
x = gunner_get_x(p); |
|
62 |
gunner_set_pos(p, x, y + speed * ver_mov); |
|
63 |
if (map_collides_gunner(map, p)) { |
|
64 |
gunner_set_pos(p, x, y); |
|
65 |
} |
|
61 | 66 |
} |
62 | 67 |
|
63 | 68 |
void update_scale(void) { |
Also available in: Unified diff