diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/so_long.h | 42 |
1 files changed, 33 insertions, 9 deletions
diff --git a/include/so_long.h b/include/so_long.h index 98b4711..11d9084 100644 --- a/include/so_long.h +++ b/include/so_long.h @@ -6,7 +6,7 @@ /* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/05/08 14:14:02 by dkaiser #+# #+# */ -/* Updated: 2024/05/09 16:13:43 by dkaiser ### ########.fr */ +/* Updated: 2024/05/09 17:38:18 by dkaiser ### ########.fr */ /* */ /* ************************************************************************** */ @@ -16,15 +16,39 @@ # include "libft.h" # include "mlx.h" +enum e_direction +{ + ZERO = 0, + UP = 1, + DOWN = 2, + LEFT = 4, + RIGHT = 8 +}; + +typedef struct s_vector +{ + int x; + int y; +} t_vector; + +typedef struct s_player +{ + t_vector position; + t_vector direction; + t_vector velocity; +} t_player; + typedef struct s_game { - void *mlx; - void *window; -} t_game; - -int init(t_game *game); -int loop(t_game *game); -int on_key_down(int key, t_game *game); -int on_key_up(int keycode, t_game *game); + void *mlx; + void *window; + t_player player; + int input_direction; +} t_game; + +int init(t_game *game); +int loop(t_game *game); +int on_key_down(int key, t_game *game); +int on_key_up(int keycode, t_game *game); #endif // SO_LONG_H |
