diff options
Diffstat (limited to '')
-rw-r--r-- | inc/cub3d_defines.h | 2 | ||||
-rw-r--r-- | inc/cub3d_structs.h | 9 | ||||
-rw-r--r-- | map/map_one.cub | 2 | ||||
-rwxr-xr-x | revelations.mp3 | bin | 0 -> 7591392 bytes | |||
-rw-r--r-- | src/ft_detect.c | 3 | ||||
-rw-r--r-- | src/ft_get_sprite.c | 7 | ||||
-rw-r--r-- | src/main.c | 13 |
7 files changed, 33 insertions, 3 deletions
diff --git a/inc/cub3d_defines.h b/inc/cub3d_defines.h index 9f54dda..f591f14 100644 --- a/inc/cub3d_defines.h +++ b/inc/cub3d_defines.h @@ -49,7 +49,7 @@ ** ====== MOVE SPEED ====== */ -# define FT_MOVE_SPEED 0.1 +# define FT_MOVE_SPEED 0.3 # define FT_STRAFE_SPEED 0.1 # define FT_ROT_SPEED 0.09 diff --git a/inc/cub3d_structs.h b/inc/cub3d_structs.h index 66686eb..f5c295c 100644 --- a/inc/cub3d_structs.h +++ b/inc/cub3d_structs.h @@ -47,6 +47,15 @@ typedef struct s_rgb int16_t b; } t_rgb; +typedef struct s_sprite +{ + int32_t s_h; + int32_t s_w; + int32_t s_start_x; + int32_t s_start_y; + int32_t s_tex_y; +} t_sprite; + typedef struct s_player { float pos_x; diff --git a/map/map_one.cub b/map/map_one.cub index 2b0db52..168e1e8 100644 --- a/map/map_one.cub +++ b/map/map_one.cub @@ -10,7 +10,7 @@ C 50,100,200 F 50,190,124 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 1 +1 2 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 N 1 1 0 0 0 0 0 1 1 1 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 diff --git a/revelations.mp3 b/revelations.mp3 Binary files differnew file mode 100755 index 0000000..2f13585 --- /dev/null +++ b/revelations.mp3 diff --git a/src/ft_detect.c b/src/ft_detect.c index 10d7147..fc49a2d 100644 --- a/src/ft_detect.c +++ b/src/ft_detect.c @@ -74,7 +74,8 @@ void cl->rlist.sqy += cl->mlist->y_step; cl->rlist.side = 1; } - if (cl->mlist->map[cl->rlist.sqx][cl->rlist.sqy] == '1') + if (cl->mlist->map[cl->rlist.sqx][cl->rlist.sqy] == '1' + || cl->mlist->map[cl->rlist.sqx][cl->rlist.sqy] == '2') cl->rlist.hit = 1; } } diff --git a/src/ft_get_sprite.c b/src/ft_get_sprite.c index ebf0566..43de290 100644 --- a/src/ft_get_sprite.c +++ b/src/ft_get_sprite.c @@ -14,6 +14,13 @@ #include <cub3d.h> #include <stdint.h> +void + ft_get_sprite_spawn(t_cub *clist) +{ + + (void)clist; +} + int8_t ft_get_sprite(char **words, t_cub *clist) { @@ -15,17 +15,30 @@ #include <cub3d.h> #include <stddef.h> #include <unistd.h> +#include <pthread.h> +#include <stdlib.h> + +void + *ft_zik(void *vargp) +{ + (void)vargp; + system("afplay revelations.mp3"); + return NULL; +} int main(int argc, const char *argv[]) { t_cub *clist; + pthread_t thread_id; if (argc < 2) { ft_dprintf(STDERR_FILENO, "Error\n\033[1;31mNo map selected\n\033[0m"); return (1); } + pthread_create(&thread_id, NULL, ft_zik, NULL); + pthread_join(thread_id, NULL); if (ft_init_cub3d(&clist) < 0) return (2); ft_parse_map(argv[1], clist); |