diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-28 16:46:40 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-28 16:46:40 +0100 |
commit | b3aecb150f55ebc9dde7c1b09559d1566e9e92a6 (patch) | |
tree | fec17255ec594ddfb6f98121d987ada32461db06 /src/ft_find_item.c | |
parent | normed (diff) | |
download | 42-cub3d-b3aecb150f55ebc9dde7c1b09559d1566e9e92a6.tar.gz 42-cub3d-b3aecb150f55ebc9dde7c1b09559d1566e9e92a6.tar.bz2 42-cub3d-b3aecb150f55ebc9dde7c1b09559d1566e9e92a6.tar.xz 42-cub3d-b3aecb150f55ebc9dde7c1b09559d1566e9e92a6.tar.zst 42-cub3d-b3aecb150f55ebc9dde7c1b09559d1566e9e92a6.zip |
All in sprites
Diffstat (limited to 'src/ft_find_item.c')
-rw-r--r-- | src/ft_find_item.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/ft_find_item.c b/src/ft_find_item.c index 59b4a4f..2d6f272 100644 --- a/src/ft_find_item.c +++ b/src/ft_find_item.c @@ -22,7 +22,8 @@ static uint16_t id = 0; while (id <= 64) { - if (cl->heals[id].s_pos_y == pos_y && cl->heals[id].s_pos_x == pos_x) + if (cl->sprites[9][id].s_pos_y == pos_y && + cl->sprites[9][id].s_pos_x == pos_x) return (id); id++; } @@ -55,8 +56,8 @@ static void else if (map_char == '#') weap_id = 2; cl->mlist.map[(uint64_t)pl->pos_y][(uint64_t)pl->pos_x] = '0'; - cl->weaps[weap_id][0].s_pos_x = 0; - cl->weaps[weap_id][0].s_pos_y = 0; + cl->sprites[10 + weap_id][0].s_pos_x = 0; + cl->sprites[10 + weap_id][0].s_pos_y = 0; pl->has_weapon[weap_id] = 1; pl->handles_weapon = (weap_id == 0) ? (0) : (pl->handles_weapon); pl->handles_weapon = (weap_id == 1) ? (2) : (pl->handles_weapon); @@ -86,8 +87,8 @@ void ml->map[(uint64_t)pl->pos_y][(uint64_t)pl->pos_x] = '0'; id = ft_fetch_heals_id((uint64_t)pl->pos_y, (uint64_t)pl->pos_x, cl); - cl->heals[id].s_pos_x = 0; - cl->heals[id].s_pos_y = 0; + cl->sprites[9][id].s_pos_x = 0; + cl->sprites[9][id].s_pos_y = 0; cl->sfx[5].sfx_play(cl->sfx); } ft_weapon_check(map_char, pl, cl); |