possibility to choose angle of view

This commit is contained in:
hugogogo
2022-04-23 11:58:11 +02:00
parent fac1f78230
commit e9b0dd7ec9
9 changed files with 72 additions and 48 deletions

View File

@@ -75,7 +75,9 @@ void draw_line(t_game *game, t_vec vec, int color)
{
t_coord incr;
t_coord pos;
int cell;
cell = game->map.cell;
incr.x = 0;
pos.x = 0;
pos.y = 0;
@@ -85,19 +87,19 @@ void draw_line(t_game *game, t_vec vec, int color)
while ((game->map.content)[incr.x][incr.y])
{
if ((game->map.content)[incr.x][incr.y] == '1' )
draw_square(game, pos, 0x00999999, 0x00000000, CELL, 0);
draw_square(game, pos, 0x00999999, 0x00000000, cell, 0);
else
draw_square(game, pos, 0x00555555, 0x00333333, CELL, 0);
draw_square(game, pos, 0x00555555, 0x00333333, cell, 0);
(incr.y)++;
pos.x += CELL;
pos.x += cell;
}
(incr.x)++;
pos.x = 0;
pos.y += CELL;
pos.y += cell;
}
pos.x = game->plr.pos.x - CELL / 2;
pos.y = game->plr.pos.y - CELL / 2;
draw_square(game, pos, 0x00999900, 0x00330033, CELL, 1);
pos.x = game->plr.pos.x - cell / 2;
pos.y = game->plr.pos.y - cell / 2;
draw_square(game, pos, 0x00999900, 0x00330033, cell, 1);
}
static void draw_screen(t_game *game, t_rcast *rcast)