diff options
Diffstat (limited to '')
-rw-r--r-- | src/ft_get_sprite.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/ft_get_sprite.c b/src/ft_get_sprite.c index 43de290..806489f 100644 --- a/src/ft_get_sprite.c +++ b/src/ft_get_sprite.c @@ -17,8 +17,26 @@ void ft_get_sprite_spawn(t_cub *clist) { + size_t x; + size_t y; - (void)clist; + x = 1; + y = 1; + while (clist->mlist->map[y]) + { + while (clist->mlist->map[y][x]) + { + if (ft_ischarset("2", clist->mlist->map[y][x])) + { + clist->sp_list.s_pos_x = x + 0.5; + clist->sp_list.s_pos_y = y + 0.5; + return ; + } + x++; + } + x = 1; + y++; + } } int8_t |