#ifndef SO_LONG_H
# define SO_LONG_H
-# define PLAYER_MOVE_SPEED 3
+# define PLAYER_MOVE_SPEED 250
# include "MLX42/MLX42.h"
# include "libft.h"
typedef struct s_vector
{
- int x;
- int y;
+ double x;
+ double y;
} t_vector;
typedef struct s_player
/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/09 15:09:24 by dkaiser #+# #+# */
-/* Updated: 2024/05/10 12:17:03 by dkaiser ### ########.fr */
+/* Updated: 2024/05/10 12:31:15 by dkaiser ### ########.fr */
/* */
/* ************************************************************************** */
- ((game->input_direction & LEFT) != 0);
game->player.direction.y = ((game->input_direction & DOWN) != 0)
- ((game->input_direction & UP) != 0);
- game->player.position.x += game->player.direction.x * PLAYER_MOVE_SPEED;
- game->player.position.y += game->player.direction.y * PLAYER_MOVE_SPEED;
+ game->player.position.x += game->player.direction.x * PLAYER_MOVE_SPEED * game->mlx->delta_time;
+ game->player.position.y += game->player.direction.y * PLAYER_MOVE_SPEED * game->mlx->delta_time;
draw(game);
}