added spawn direction
This commit is contained in:
parent
ba87f4a37c
commit
78fa8c8967
1 changed files with 13 additions and 5 deletions
18
algo.c
18
algo.c
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* algo.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: mcolonna <mcolonna@student.42.fr> +#+ +:+ +#+ */
|
||||
/* By: grobledo <grobledo@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* 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}
|
||||
};
|
||||
|
||||
static int initalgo()
|
||||
static int initalgo(char posplayer)
|
||||
{
|
||||
// TODO from map
|
||||
g_ray.posX = 14;
|
||||
g_ray.posY = 6.5;
|
||||
g_ray.rot = 0;
|
||||
g_ray.posY = 17;
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
void draw_screen(void) {
|
||||
int bpp;
|
||||
int size_line;
|
||||
|
|
Loading…
Add table
Reference in a new issue