wip: Adding weapon class and usage

This commit is contained in:
Theo Champion 2025-09-11 23:41:00 +02:00
parent 87c0a8a991
commit b0ac26a7f6
13 changed files with 82 additions and 43 deletions

View file

@ -6,7 +6,7 @@
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/08/06 11:29:14 by kcolin #+# #+# */
/* Updated: 2025/09/03 16:37:56 by tchampio ### ########.fr */
/* Updated: 2025/09/10 15:58:32 by tchampio ### ########.fr */
/* */
/* ************************************************************************** */
@ -14,6 +14,7 @@
#include "../../libft/includes/libft.h"
#include "../map/mapdata.h"
#include "../consts.h"
#include "../hud/load_texture.h"
// east west
void init_lon(t_player *player, char dir)
@ -53,7 +54,7 @@ void init_lat(t_player *player, char dir)
}
}
void init_player(t_player *player, t_mapdata *map)
void init_player(t_cub3d_data *data, t_player *player, t_mapdata *map)
{
char dir;
@ -63,6 +64,8 @@ void init_player(t_player *player, t_mapdata *map)
player->health = 100;
player->points = 500;
ft_bzero(player->perk_order, 3);
ft_bzero(&player->weapon, sizeof(t_weapon));
player->weapon.texture = load_hud_texture(data, "ressources/weapon.xpm");
if (dir == 'N' || dir == 'S')
init_lon(player, dir);
else