updated readme

This commit is contained in:
djonker 2023-11-05 08:12:18 +01:00
parent 55c73777db
commit b1ba73ae64
4 changed files with 14 additions and 14 deletions

View File

@ -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

View File

@ -6,7 +6,7 @@
/* By: houtworm <codam@houtworm.net> +#+ */
/* +#+ */
/* 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;

View File

@ -6,7 +6,7 @@
/* By: houtworm <codam@houtworm.net> +#+ */
/* +#+ */
/* 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);
}

View File

@ -6,7 +6,7 @@
/* By: houtworm <codam@houtworm.net> +#+ */
/* +#+ */
/* 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);