mirror of
https://codeberg.org/ACME-Corporation/cub3d.git
synced 2025-12-06 09:58:09 +01:00
feat: Made zombies killable
Code is almost normed I will make a function to handle sprites interractions
This commit is contained in:
parent
46b40540dc
commit
37bb56733e
6 changed files with 37 additions and 10 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/08/18 13:52:23 by kcolin #+# #+# */
|
||||
/* Updated: 2025/09/09 14:08:10 by tchampio ### ########.fr */
|
||||
/* Updated: 2025/09/15 14:36:47 by tchampio ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -37,6 +37,7 @@ void create_zombie(t_cub3d_data *data, double x, double y)
|
|||
data->sprite_list[data->sprite_counter] = create_sprite(data,
|
||||
"ressources/zombie.xpm", x, y);
|
||||
data->sprite_list[data->sprite_counter]->sprite_type = ZOMBIE;
|
||||
data->sprite_list[data->sprite_counter]->health = 250;
|
||||
data->sprite_counter++;
|
||||
}
|
||||
|
||||
|
|
@ -59,6 +60,7 @@ t_sprite *place_right_sprite(t_cub3d_data *data, char c, double x, double y)
|
|||
{
|
||||
sprite = create_sprite(data, ZOMBIE_TEX, x + 0.5, y + 0.5);
|
||||
sprite->sprite_type = ZOMBIE;
|
||||
sprite->health = 250;
|
||||
}
|
||||
if (c == 'D' || c == 'Q' || c == 'J')
|
||||
sprite->sprite_type = PERK;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue