Project

General

Profile

Revision 184

movement semi-implemented; missing structure

View differences:

proj_func.c
25 25

  
26 26
static int hor_mov = REST, ver_mov = REST;
27 27

  
28
void update_movement(void) {
28
void update_key_presses(void) {
29 29
    static int w_pressed = 0, a_pressed = 0, s_pressed = 0, d_pressed = 0;
30 30
    if (sz == 1) {
31 31
        switch(scancode[0]) {
......
43 43
    hor_mov = d_pressed - a_pressed;
44 44
}
45 45

  
46
void update_movement(sprite_t *p) {
47

  
48
    static const int speed = 5;
49
    sprite_set_pos(p, sprite_get_x(p) + speed * hor_mov, sprite_get_y(p) + speed * ver_mov);
50
}
51

  
46 52
static int32_t mouse_x = 0, mouse_y = 0;
47 53

  
48 54
void update_mouse_position(struct packet *p) {

Also available in: Unified diff