Project

General

Profile

Revision 192

added zoom/scale

View differences:

proj_func.c
43 43
    hor_mov = d_pressed - a_pressed;
44 44
}
45 45

  
46
void update_movement(sprite_t *p) {
47

  
46
void update_movement(ent_t *p) {
48 47
    static const int speed = 5;
49
    sprite_set_pos(p, sprite_get_x(p) + speed * hor_mov, sprite_get_y(p) + speed * ver_mov);
48
    ent_set_pos(p, ent_get_x(p) + speed * hor_mov, ent_get_y(p) + speed * ver_mov);
50 49
}
51 50

  
52 51
static int32_t mouse_x = 0, mouse_y = 0;
......
63 62

  
64 63
int32_t get_mouse_Y(void) { return mouse_y; }
65 64

  
66
double get_mouse_angle(sprite_t *p) {
67
    return atan2(sprite_get_y(p) - mouse_y, mouse_x - sprite_get_x(p));
65
double get_mouse_angle(ent_t *p) {
66
    return atan2(ent_get_y_screen(p) - mouse_y, mouse_x - ent_get_x_screen(p));
68 67
}
69 68

  
70 69
int get_hor_movement(void) { return hor_mov; }

Also available in: Unified diff