aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_get_traps.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-11 10:16:48 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-11 10:16:48 +0100
commitc581c7e3543058f015bddf96d76ac2d771ea40a0 (patch)
treeb3c8fe72a65ac834fcd7edaef4e2887f49d53c90 /src/ft_get_traps.c
parentParsed traps (diff)
download42-cub3d-c581c7e3543058f015bddf96d76ac2d771ea40a0.tar.gz
42-cub3d-c581c7e3543058f015bddf96d76ac2d771ea40a0.tar.bz2
42-cub3d-c581c7e3543058f015bddf96d76ac2d771ea40a0.tar.xz
42-cub3d-c581c7e3543058f015bddf96d76ac2d771ea40a0.tar.zst
42-cub3d-c581c7e3543058f015bddf96d76ac2d771ea40a0.zip
Nice parse
Diffstat (limited to '')
-rw-r--r--src/ft_get_traps.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/ft_get_traps.c b/src/ft_get_traps.c
index cdc05de..0235bb5 100644
--- a/src/ft_get_traps.c
+++ b/src/ft_get_traps.c
@@ -14,6 +14,34 @@
#include <cub3d.h>
#include <stdint.h>
+void
+ ft_get_trap_spawn(t_cub *clist)
+{
+ size_t x;
+ size_t y;
+ uint8_t i;
+
+ x = 1;
+ y = 1;
+ i = 0;
+ while (clist->mlist.map[y])
+ {
+ while (clist->mlist.map[y][x])
+ {
+ if (clist->mlist.map[y][x] == 'T')
+ {
+ clist->mlist.traps_nbr++;
+ clist->traps[i].s_pos_x = x;
+ clist->traps[i].s_pos_y = y;
+ i++;
+ }
+ x++;
+ }
+ x = 1;
+ y++;
+ }
+}
+
int8_t
ft_get_traps(char **words, t_cub *clist)
{