summaryrefslogtreecommitdiff
path: root/player_erase.c
diff options
context:
space:
mode:
Diffstat (limited to 'player_erase.c')
-rw-r--r--player_erase.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/player_erase.c b/player_erase.c
new file mode 100644
index 0000000..bc3a5e1
--- /dev/null
+++ b/player_erase.c
@@ -0,0 +1,30 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* player_erase.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: kdx <kdx @student.42angouleme.fr +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2022/10/17 11:32:56 by kdx #+# #+# */
+/* Updated: 2022/10/17 11:32:58 by kdx ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#include "player.h"
+#include "game.h"
+#include "map.h"
+#include "sily.h"
+#include <math.h>
+
+void player_erase(t_sily *sily, double pos[2])
+{
+ int x;
+ int y;
+
+ x = round(pos[0]);
+ y = round(pos[1]);
+ map_draw_tile(sily, &sily->game->map, x, y);
+ map_draw_tile(sily, &sily->game->map, x + TSIZE, y + TSIZE);
+ map_draw_tile(sily, &sily->game->map, x + TSIZE, y);
+ map_draw_tile(sily, &sily->game->map, x, y + TSIZE);
+}