added spawn direction

This commit is contained in:
Gregory Robledo 2024-10-15 16:35:16 +02:00
parent ba87f4a37c
commit 78fa8c8967

18
algo.c
View file

@ -3,10 +3,10 @@
/* ::: :::::::: */ /* ::: :::::::: */
/* algo.c :+: :+: :+: */ /* algo.c :+: :+: :+: */
/* +:+ +:+ +:+ */ /* +:+ +:+ +:+ */
/* By: mcolonna <mcolonna@student.42.fr> +#+ +:+ +#+ */ /* By: grobledo <grobledo@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/01 16:24:58 by grobledo #+# #+# */ /* Created: 2024/10/01 16:24:58 by grobledo #+# #+# */
/* Updated: 2024/10/15 14:10:11 by mcolonna ### ########.fr */ /* Updated: 2024/10/15 16:34:46 by grobledo ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -44,15 +44,23 @@ int worldMap[mapWidth][mapHeight] =
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1} {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}
}; };
static int initalgo() static int initalgo(char posplayer)
{ {
// TODO from map // TODO from map
g_ray.posX = 14; g_ray.posX = 14;
g_ray.posY = 6.5; g_ray.posY = 17;
g_ray.rot = 0; if (posplayer == 'N')
g_ray.rot = 0;
if (posplayer == 'S')
g_ray.rot = PI;
if (posplayer == 'W')
g_ray.rot = (3 * PI) / 2;
if (posplayer == 'E')
g_ray.rot = PI/2;
return (0); return (0);
} }
void draw_screen(void) { void draw_screen(void) {
int bpp; int bpp;
int size_line; int size_line;