cub3d/src/player.c

30 lines
1.2 KiB
C

/* ************************************************************************** */
/* */
/* :::::::: */
/* player.c :+: :+: */
/* +:+ */
/* By: qmennen <qmennen@student.codam.nl> +#+ */
/* +#+ */
/* Created: 2025/04/15 18:53:19 by qmennen #+# #+# */
/* Updated: 2025/05/23 15:22:22 by whaffman ######## odam.nl */
/* */
/* ************************************************************************** */
#include "cub3d.h"
int player_create(t_game **game)
{
t_player *player;
player = malloc(sizeof(t_player));
if (!player)
return (FAILURE);
ft_memset(player, 0, sizeof(t_player));
player->pos.x = -1;
player->pos.y = -1;
player->speed = 3.f;
player->battery = .5f;
(*game)->player = player;
return (SUCCESS);
}