diff --git a/src/player.c b/src/player.c index 6c87fc4..f90c3c2 100644 --- a/src/player.c +++ b/src/player.c @@ -15,10 +15,11 @@ object_t* player_instance = NULL; void player_update(object_t *object) { float m = sqrtf(player_move_x*player_move_x + player_move_y*player_move_y); if(m == FP_NAN) m = 1; - player_xv = player_move_x * 10.f / m, - player_yv = player_move_y * 10.f / m; - object->sprite.x += player_xv* delta_time(); - object->sprite.y += player_yv* delta_time(); + m = 1.f/m; + player_xv = player_move_x * 3.f * m, + player_yv = player_move_y * 3.f * m; + object->sprite.x += player_xv * delta_time(); + object->sprite.y += player_yv * delta_time(); } object_t* create_player() { diff --git a/src/player.h b/src/player.h index 52c65a7..3f116e9 100644 --- a/src/player.h +++ b/src/player.h @@ -3,10 +3,8 @@ struct object_t; -extern float player_move_x; -extern float player_move_y; -extern float player_xv; -extern float player_yv; +extern float player_move_x, player_move_y, + player_xv, player_yv; extern struct object_t* player_instance; void player_update(struct object_t* object);