fix: moving
This commit is contained in:
parent
4ea2cf266b
commit
d7903ec615
1 changed files with 2 additions and 2 deletions
4
move.c
4
move.c
|
@ -6,7 +6,7 @@
|
||||||
/* By: mcolonna <mcolonna@student.42.fr> +#+ +:+ +#+ */
|
/* By: mcolonna <mcolonna@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/10/15 12:47:34 by mcolonna #+# #+# */
|
/* Created: 2024/10/15 12:47:34 by mcolonna #+# #+# */
|
||||||
/* Updated: 2024/10/15 18:22:58 by mcolonna ### ########.fr */
|
/* Updated: 2024/10/17 12:29:23 by mcolonna ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ static int move(int factor)
|
||||||
(int)(g_map.player.pos.y)
|
(int)(g_map.player.pos.y)
|
||||||
)->wall == EMPTY
|
)->wall == EMPTY
|
||||||
)
|
)
|
||||||
g_map.player.pos.x += dir.x * MOVE_SPEED;
|
g_map.player.pos.x += dir.x * MOVE_SPEED * factor;
|
||||||
if (map_get_case(&g_map,
|
if (map_get_case(&g_map,
|
||||||
(int)(g_map.player.pos.x),
|
(int)(g_map.player.pos.x),
|
||||||
(int)(g_map.player.pos.y + dir.y * MOVE_SPEED * factor)
|
(int)(g_map.player.pos.y + dir.y * MOVE_SPEED * factor)
|
||||||
|
|
Loading…
Add table
Reference in a new issue