mirror of
https://codeberg.org/ACME-Corporation/cub3d.git
synced 2025-12-06 01:48:08 +01:00
feat: Made a the box usable
This commit is contained in:
parent
6158618d36
commit
0e99c6da49
1 changed files with 12 additions and 3 deletions
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: tchampio <tchampio@student.42lehavre.fr> +#+ +:+ +#+ */
|
/* By: tchampio <tchampio@student.42lehavre.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2025/10/03 18:18:04 by tchampio #+# #+# */
|
/* Created: 2025/10/03 18:18:04 by tchampio #+# #+# */
|
||||||
/* Updated: 2025/10/03 18:19:03 by tchampio ### ########.fr */
|
/* Updated: 2025/10/07 12:51:07 by tchampio ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
@ -50,6 +50,13 @@ void pay_and_give(t_cub3d_data *data, t_sprite *current_sprite)
|
||||||
if (last_perk_pos > 2)
|
if (last_perk_pos > 2)
|
||||||
return ;
|
return ;
|
||||||
symbol = data->map->map[(int)current_sprite->y][(int)current_sprite->x];
|
symbol = data->map->map[(int)current_sprite->y][(int)current_sprite->x];
|
||||||
|
if (symbol == 'M' && pay(data, 950, false)
|
||||||
|
&& data->player.weapon != data->weaponsregistry[1])
|
||||||
|
{
|
||||||
|
data->player.weapon = data->weaponsregistry[1];
|
||||||
|
ft_printf("Gave player enhanced gun\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
pick_right_perk(symbol, data, &last_perk_pos);
|
pick_right_perk(symbol, data, &last_perk_pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -62,7 +69,9 @@ void handle_sprite_interactions(t_cub3d_data *data)
|
||||||
if (data->sprite_distances[data->sprite_counter - 1] <= 1.5)
|
if (data->sprite_distances[data->sprite_counter - 1] <= 1.5)
|
||||||
{
|
{
|
||||||
if (data->sprite_list[data->sprite_order[data->sprite_counter - 1]]
|
if (data->sprite_list[data->sprite_order[data->sprite_counter - 1]]
|
||||||
->sprite_type == PERK)
|
->sprite_type == PERK
|
||||||
|
|| data->sprite_list
|
||||||
|
[data->sprite_order[data->sprite_counter - 1]]->sprite_type == BOX)
|
||||||
{
|
{
|
||||||
if (data->keypresses.is_f_pressed)
|
if (data->keypresses.is_f_pressed)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue