2023-04-26 09:45:21 -04:00
|
|
|
/* ************************************************************************** */
|
|
|
|
/* */
|
|
|
|
/* ::: :::::::: */
|
|
|
|
/* game.h :+: :+: :+: */
|
|
|
|
/* +:+ +:+ +:+ */
|
|
|
|
/* By: erey-bet <marvin@42.fr> +#+ +:+ +#+ */
|
|
|
|
/* +#+#+#+#+#+ +#+ */
|
|
|
|
/* Created: 2023/04/26 15:29:34 by erey-bet #+# #+# */
|
2023-04-27 09:13:32 -04:00
|
|
|
/* Updated: 2023/04/27 14:52:04 by erey-bet ### ########.fr */
|
2023-04-26 09:45:21 -04:00
|
|
|
/* */
|
|
|
|
/* ************************************************************************** */
|
|
|
|
|
|
|
|
#ifndef GAME_H
|
|
|
|
# define GAME_H
|
|
|
|
|
2023-04-27 09:13:32 -04:00
|
|
|
# include "../cube3D.h"
|
|
|
|
|
2023-04-26 09:45:21 -04:00
|
|
|
typedef struct s_player
|
|
|
|
{
|
|
|
|
double pos_x;
|
|
|
|
double pos_y;
|
|
|
|
} t_ply;
|
|
|
|
|
|
|
|
typedef struct s_game
|
|
|
|
{
|
|
|
|
mlx_t *mlx;
|
2023-04-27 09:13:32 -04:00
|
|
|
mlx_image_t *window;
|
2023-04-26 09:45:21 -04:00
|
|
|
t_ply *ply;
|
2023-04-27 09:13:32 -04:00
|
|
|
t_map *map;
|
2023-04-26 09:45:21 -04:00
|
|
|
} t_game;
|
|
|
|
|
2023-04-27 09:13:32 -04:00
|
|
|
/* INIT */
|
|
|
|
t_game *init(t_map *map);
|
|
|
|
|
|
|
|
/* MANAGE */
|
|
|
|
void manage(mlx_key_data_t keydata, void *param);
|
|
|
|
|
|
|
|
/* KEYS */
|
|
|
|
int manage_keys(mlx_key_data_t keydata, t_game *game);
|
|
|
|
|
|
|
|
/* RAYCASTING */
|
|
|
|
int raycasting(t_game *game);
|
|
|
|
|
2023-04-26 09:45:21 -04:00
|
|
|
#endif
|