mirror of
https://codeberg.org/ACME-Corporation/cub3d.git
synced 2025-12-06 01:48:08 +01:00
Compare commits
No commits in common. "4a513e9877e17e54fc7dce1383371ae1ca32a85d" and "3a1ee2fb3db2d890f0664d154383b420ffc09c2a" have entirely different histories.
4a513e9877
...
3a1ee2fb3d
5 changed files with 11 additions and 24 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/07/17 14:54:36 by kcolin #+# #+# */
|
||||
/* Updated: 2025/10/07 13:49:26 by tchampio ### ########.fr */
|
||||
/* Updated: 2025/08/19 20:07:29 by tchampio ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -53,7 +53,7 @@
|
|||
# define ENOCUB "Not a .cub file"
|
||||
# define EOPEN "Can't open file"
|
||||
# define EMALMAP "Map is malformed (invalid chars or missing walls)"
|
||||
# define ENOPLAYER "No player or no map (monster!!)"
|
||||
# define ENOPLAYER "No player"
|
||||
# define EHOLES "Holes in map"
|
||||
# define ETRAILING "Trailing chars after map"
|
||||
# define EBADCHARCOLOR "invalid characters in color definition"
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* hud.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: freddy <freddy@student.42.fr> +#+ +:+ +#+ */
|
||||
/* By: tchampio <tchampio@student.42lehavre.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/09/08 17:27:12 by tchampio #+# #+# */
|
||||
/* Updated: 2025/10/07 13:41:00 by freddy ### ########.fr */
|
||||
/* Updated: 2025/09/17 16:55:05 by tchampio ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -91,8 +91,4 @@ void create_hud(t_cub3d_data *data)
|
|||
matrix_image_put(data, data->player.weapon->texture,
|
||||
WIDTH / 2, HEIGHT - 175);
|
||||
matrix_set(data, WIDTH / 2, HEIGHT / 2, 0x0000FF00);
|
||||
matrix_set(data, WIDTH / 2 + 1, HEIGHT / 2, 0x0000FF00);
|
||||
matrix_set(data, WIDTH / 2 - 1, HEIGHT / 2, 0x0000FF00);
|
||||
matrix_set(data, WIDTH / 2, HEIGHT / 2 + 1, 0x0000FF00);
|
||||
matrix_set(data, WIDTH / 2, HEIGHT / 2 - 1, 0x0000FF00);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/07/17 14:15:26 by kcolin #+# #+# */
|
||||
/* Updated: 2025/10/07 13:48:17 by tchampio ### ########.fr */
|
||||
/* Updated: 2025/10/03 23:51:46 by tchampio ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -74,7 +74,7 @@ bool check_bare_minimum(t_mapdata *map)
|
|||
|
||||
i = 0;
|
||||
spawncount = 0;
|
||||
while (map->map && map->map[i])
|
||||
while (map->map[i])
|
||||
{
|
||||
j = 0;
|
||||
while (map->map[i][j])
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/08/06 11:29:14 by kcolin #+# #+# */
|
||||
/* Updated: 2025/10/07 12:49:37 by tchampio ### ########.fr */
|
||||
/* Updated: 2025/09/18 12:06:58 by tchampio ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -64,7 +64,7 @@ void init_player(t_cub3d_data *data, t_player *player, t_mapdata *map)
|
|||
player->health = 100;
|
||||
player->points = 500;
|
||||
ft_bzero(player->perk_order, 3);
|
||||
player->weapon = data->weaponsregistry[0];
|
||||
player->weapon = data->weaponsregistry[1];
|
||||
if (dir == 'N' || dir == 'S')
|
||||
init_lon(player, dir);
|
||||
else
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: tchampio <tchampio@student.42lehavre.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/10/03 18:18:04 by tchampio #+# #+# */
|
||||
/* Updated: 2025/10/07 12:51:07 by tchampio ### ########.fr */
|
||||
/* Updated: 2025/10/03 18:19:03 by tchampio ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -50,14 +50,7 @@ void pay_and_give(t_cub3d_data *data, t_sprite *current_sprite)
|
|||
if (last_perk_pos > 2)
|
||||
return ;
|
||||
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);
|
||||
}
|
||||
|
||||
void handle_sprite_interactions(t_cub3d_data *data)
|
||||
|
|
@ -69,9 +62,7 @@ void handle_sprite_interactions(t_cub3d_data *data)
|
|||
if (data->sprite_distances[data->sprite_counter - 1] <= 1.5)
|
||||
{
|
||||
if (data->sprite_list[data->sprite_order[data->sprite_counter - 1]]
|
||||
->sprite_type == PERK
|
||||
|| data->sprite_list
|
||||
[data->sprite_order[data->sprite_counter - 1]]->sprite_type == BOX)
|
||||
->sprite_type == PERK)
|
||||
{
|
||||
if (data->keypresses.is_f_pressed)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue