feat: game over and win screens *

feat:
- win screen
- "press enter to retry" in both screens
- reset moves only when winning the game

change:
- game over screen display
- display top-left move a little differently

dev:
- scripts to import different text sizes
This commit is contained in:
mcolonna 2024-04-19 13:19:53 +02:00
parent bc9cee22d7
commit 30a935cf70
53 changed files with 4140 additions and 2163 deletions

View file

@ -6,14 +6,14 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/29 17:43:01 by mcolonna #+# #+# */
/* Updated: 2024/04/18 20:07:12 by mcolonna ### ########.fr */
/* Updated: 2024/04/19 13:00:28 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef DATA_ASSETS_H
# define DATA_ASSETS_H
# define NB_ASSETS 107
# define NB_ASSETS 121
typedef struct s_assetmeta
{
@ -140,8 +140,22 @@ typedef enum e_assetsmap_id
TEXT_LITTLE_7,
TEXT_LITTLE_8,
TEXT_LITTLE_9,
TEXT_GAMEOVER,
TEXT_YOUDED,
TEXT_LITTLE_PRESSENTERTORETRY,
TEXT_REGULAR_0,
TEXT_REGULAR_1,
TEXT_REGULAR_2,
TEXT_REGULAR_3,
TEXT_REGULAR_4,
TEXT_REGULAR_5,
TEXT_REGULAR_6,
TEXT_REGULAR_7,
TEXT_REGULAR_8,
TEXT_REGULAR_9,
TEXT_REGULAR_IN_X_MOVES_1,
TEXT_REGULAR_IN_X_MOVES_2,
TEXT_REGULAR_YOUDED,
TEXT_BIG_YOUWIN,
TEXT_BIG_GAMEOVER,
} t_assetsmap_id;
# define OBJECT_SNAS OBJECT_SNAS_DOWN

View file

@ -6,14 +6,14 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/11 15:56:31 by mcolonna #+# #+# */
/* Updated: 2024/04/18 18:24:20 by mcolonna ### ########.fr */
/* Updated: 2024/04/19 12:59:36 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef DATA_SPRITES_H
# define DATA_SPRITES_H
# define NB_SPRITES 27
# define NB_SPRITES 25
typedef enum e_spritetype
{
@ -61,8 +61,6 @@ typedef enum e_spritesmap_id
SPR_KNIFEATTACK,
SPR_EXPLOSION_1,
SPR_EXPLOSION_2,
SPR_GAMEOVER,
SPR_YOUDED,
} t_spritesmap_id;
#endif

View file

@ -6,7 +6,7 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/18 19:54:06 by mcolonna #+# #+# */
/* Updated: 2024/04/18 20:02:12 by mcolonna ### ########.fr */
/* Updated: 2024/04/19 11:53:25 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
@ -16,6 +16,6 @@
# include "includes.h"
void display_text(t_point *p, t_assetsmap_id asset);
void display_uint(t_point *p, unsigned int n);
void display_uint(t_point *p, unsigned int n, bool little);
#endif