diff --git a/Readme.md b/Readme.md index b7bd152..c4d60a3 100644 --- a/Readme.md +++ b/Readme.md @@ -27,8 +27,6 @@ Cub3D is a simple raycasting game using the mlx library - Sounds? - Music? - A Start Menu? -- Jumping? -- Crouching? --- ## Features @@ -48,13 +46,15 @@ Cub3D is a simple raycasting game using the mlx library - FPS counter - Player can walk in 8 directions - Player can Run +- Player can Jump +- Player can Crouch - Map sizes up to 1 Megabyte (1000x1000) +- Player can collect Treasure - Vertical Aiming - Fullscreen - Barrels - Lights - --- ## Bugs - Player gets stuck in walls diff --git a/cub3d.h b/cub3d.h index 954aa12..eff5241 100644 --- a/cub3d.h +++ b/cub3d.h @@ -6,7 +6,7 @@ /* By: houtworm +#+ */ /* +#+ */ /* Created: 2023/10/26 10:46:35 by houtworm #+# #+# */ -/* Updated: 2023/11/05 07:59:59 by houtworm ######## odam.nl */ +/* Updated: 2023/11/05 08:05:51 by houtworm ######## odam.nl */ /* */ /* ************************************************************************** */ @@ -36,7 +36,7 @@ typedef struct s_varlist mlx_image_t *fstat; mlx_image_t *tstat; mlx_image_t *kstat; - mlx_texture_t *curtext; + mlx_texture_t *temptext; mlx_texture_t *northtext; mlx_texture_t *easttext; mlx_texture_t *southtext; diff --git a/src/draw/texture.c b/src/draw/texture.c index bd47267..f9d5e6e 100644 --- a/src/draw/texture.c +++ b/src/draw/texture.c @@ -6,7 +6,7 @@ /* By: houtworm +#+ */ /* +#+ */ /* Created: 2023/10/26 16:54:20 by houtworm #+# #+# */ -/* Updated: 2023/11/05 07:29:26 by houtworm ######## odam.nl */ +/* Updated: 2023/11/05 08:06:21 by houtworm ######## odam.nl */ /* */ /* ************************************************************************** */ @@ -17,16 +17,16 @@ void ft_selecttexture(t_varlist *vl) if (vl->side == 0) { if (vl->raydirx > 0) - vl->curtext = vl->northtext; + vl->temptext = vl->northtext; else - vl->curtext = vl->southtext; + vl->temptext = vl->southtext; } else { if (vl->raydiry > 0) - vl->curtext = vl->westtext; + vl->temptext = vl->westtext; else - vl->curtext = vl->easttext; + vl->temptext = vl->easttext; } } @@ -54,7 +54,7 @@ uint32_t ft_gettextcolor(t_varlist *vl, int texty, int textx) uint8_t *texel; uint32_t color; - texel = &vl->curtext->pixels[(vl->curtext->width * texty + textx) * 4]; + texel = &vl->temptext->pixels[(vl->temptext->width * texty + textx) * 4]; color = texel[0] << 24 | texel[1] << 16 | texel[2] << 8 | texel[3]; return (color); } diff --git a/src/sprite/draw.c b/src/sprite/draw.c index 38ecd8f..12ca69e 100644 --- a/src/sprite/draw.c +++ b/src/sprite/draw.c @@ -6,7 +6,7 @@ /* By: houtworm +#+ */ /* +#+ */ /* Created: 2023/10/26 16:54:20 by houtworm #+# #+# */ -/* Updated: 2023/11/05 06:40:15 by houtworm ######## odam.nl */ +/* Updated: 2023/11/05 08:06:48 by houtworm ######## odam.nl */ /* */ /* ************************************************************************** */ @@ -85,7 +85,7 @@ void ft_drawsprites(t_varlist *vl) { spritex = vl->sprite[i].x - vl->posx; spritey = vl->sprite[i].y - vl->posy; - vl->curtext = ft_selectsprite(vl, vl->sprite[i].type); + vl->temptext = ft_selectsprite(vl, vl->sprite[i].type); invdet = 1.0 / (vl->planex * vl->diry - vl->dirx * vl->planey); transformx = invdet * (vl->diry * spritex - vl->dirx * spritey); transformy = invdet * (-vl->planey * spritex + vl->planex * spritey); @@ -125,7 +125,7 @@ void ft_drawsprites(t_varlist *vl) texx = 0; if (texx > 64) texx = 64; - texel = &vl->curtext->pixels[(vl->curtext->width * texy + texx) * 4]; + texel = &vl->temptext->pixels[(vl->temptext->width * texy + texx) * 4]; color = texel[0] << 24 | texel[1] << 16 | texel[2] << 8 | texel[3]; if (color != 0x980088FF) mlx_put_pixel(vl->img, x, y, color);