feat: loots of things!!! *
Added features: - Check if the room is valid - Pathfinding - Firsk - Camera Changes: - Borders Dev: - new test rooms - ber.vim plugin
This commit is contained in:
parent
b7a2d0494f
commit
9e81a59a7e
95 changed files with 8342 additions and 147 deletions
|
|
@ -6,14 +6,14 @@
|
|||
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/02/29 17:43:01 by mcolonna #+# #+# */
|
||||
/* Updated: 2024/04/05 18:43:19 by mcolonna ### ########.fr */
|
||||
/* Updated: 2024/04/11 16:20:07 by mcolonna ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef DATA_ASSETS_H
|
||||
# define DATA_ASSETS_H
|
||||
|
||||
# define NB_ASSETS 48
|
||||
# define NB_ASSETS 61
|
||||
|
||||
typedef struct s_assetmeta
|
||||
{
|
||||
|
|
@ -37,7 +37,8 @@ typedef enum e_assetsmap_id
|
|||
{
|
||||
FLOOR_1,
|
||||
FLOOR_2,
|
||||
WALL_BORDER,
|
||||
WALL_BORDER_TOP,
|
||||
WALL_BORDER_BOTTOM,
|
||||
WALL_INNER,
|
||||
OBJECT_SNAS_DOWN,
|
||||
OBJECT_SNAS_UP,
|
||||
|
|
@ -55,10 +56,6 @@ typedef enum e_assetsmap_id
|
|||
OBJECT_SNAS_WALK_UP_2,
|
||||
OBJECT_SNAS_WALK_UP_3,
|
||||
OBJECT_SNAS_WALK_UP_4,
|
||||
OBJECT_FIRSK_DOWN,
|
||||
OBJECT_FIRST_UP,
|
||||
OBJECT_FIRST_LEFT,
|
||||
OBJECT_FIRSK_RIGHT,
|
||||
OBJECT_KETCHUP_STILL_1,
|
||||
OBJECT_KETCHUP_STILL_2,
|
||||
OBJECT_KETCHUP_STILL_3,
|
||||
|
|
@ -82,7 +79,23 @@ typedef enum e_assetsmap_id
|
|||
OBJECT_EXIT_USING2_4,
|
||||
OBJECT_EXIT_USING2_5,
|
||||
OBJECT_EXIT_USING2_6,
|
||||
OBJECT_EXIT_USING2_7
|
||||
OBJECT_EXIT_USING2_7,
|
||||
OBJECT_FIRSK_DOWN,
|
||||
OBJECT_FIRSK_UP,
|
||||
OBJECT_FIRSK_LEFT,
|
||||
OBJECT_FIRSK_RIGHT,
|
||||
OBJECT_FIRSK_WALK_DOWN_1,
|
||||
OBJECT_FIRSK_WALK_DOWN_2,
|
||||
OBJECT_FIRSK_WALK_DOWN_3,
|
||||
OBJECT_FIRSK_WALK_DOWN_4,
|
||||
OBJECT_FIRSK_WALK_RIGHT_1,
|
||||
OBJECT_FIRSK_WALK_RIGHT_2,
|
||||
OBJECT_FIRSK_WALK_LEFT_1,
|
||||
OBJECT_FIRSK_WALK_LEFT_2,
|
||||
OBJECT_FIRSK_WALK_UP_1,
|
||||
OBJECT_FIRSK_WALK_UP_2,
|
||||
OBJECT_FIRSK_WALK_UP_3,
|
||||
OBJECT_FIRSK_WALK_UP_4,
|
||||
} t_assetsmap_id;
|
||||
|
||||
# define OBJECT_SNAS OBJECT_SNAS_DOWN
|
||||
|
|
|
|||
|
|
@ -6,14 +6,14 @@
|
|||
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/03/11 15:56:31 by mcolonna #+# #+# */
|
||||
/* Updated: 2024/04/08 15:30:53 by mcolonna ### ########.fr */
|
||||
/* Updated: 2024/04/11 16:22:44 by mcolonna ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef DATA_SPRITES_H
|
||||
# define DATA_SPRITES_H
|
||||
|
||||
# define NB_SPRITES 14
|
||||
# define NB_SPRITES 20
|
||||
|
||||
typedef enum e_spritetype
|
||||
{
|
||||
|
|
@ -36,7 +36,8 @@ extern const t_spritemeta g_spritesmap[NB_SPRITES];
|
|||
|
||||
typedef enum e_spritesmap_id
|
||||
{
|
||||
CASE_WALL,
|
||||
CASE_BORDER_TOP,
|
||||
CASE_BORDER_BOTTOM,
|
||||
CASE_FLOOR_1,
|
||||
CASE_FLOOR_2,
|
||||
SPR_SNAS,
|
||||
|
|
@ -50,6 +51,11 @@ typedef enum e_spritesmap_id
|
|||
SPR_EXIT_INACTIVE,
|
||||
SPR_EXIT_ACTIVE,
|
||||
SPR_EXIT_USING,
|
||||
SPR_FIRSK,
|
||||
SPR_FIRSK_WALK_DOWN,
|
||||
SPR_FIRSK_WALK_UP,
|
||||
SPR_FIRSK_WALK_RIGHT,
|
||||
SPR_FIRSK_WALK_LEFT,
|
||||
} t_spritesmap_id;
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/02/26 14:32:08 by mcolonna #+# #+# */
|
||||
/* Updated: 2024/04/02 17:26:51 by mcolonna ### ########.fr */
|
||||
/* Updated: 2024/04/11 17:15:31 by mcolonna ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -35,9 +35,9 @@ void display_erase(void);
|
|||
/**
|
||||
* Draw an image somewhere in the window.
|
||||
* You must call display_flush() after drawing all images.
|
||||
* x,y is the top-left position of the image.
|
||||
* p is the top-left position of the image.
|
||||
*/
|
||||
void display_draw(int x, int y, t_assetsmap_id asset);
|
||||
void display_draw(t_point p, t_assetsmap_id asset);
|
||||
|
||||
/**
|
||||
* Draw all the screen in the buffer.
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/03/07 22:13:20 by mcolonna #+# #+# */
|
||||
/* Updated: 2024/04/03 15:56:22 by mcolonna ### ########.fr */
|
||||
/* Updated: 2024/04/11 17:06:52 by mcolonna ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -22,7 +22,7 @@ typedef struct s_sprite
|
|||
t_sprite sprite_init(t_spritesmap_id spr);
|
||||
|
||||
// Return false only if the image drawn was the last (end of the animation).
|
||||
bool sprite_draw(int x, int y, t_sprite *spr);
|
||||
bool sprite_draw(t_point p, t_sprite *spr);
|
||||
|
||||
void sprite_character_set_direction(t_sprite *spr, t_direction value);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue