From fd182b5f3cb8ac15f5ca726e65bd0d30a319e800 Mon Sep 17 00:00:00 2001 From: SlyVTT Date: Tue, 22 Aug 2023 10:48:01 +0200 Subject: [PATCH] Some minor tuning on dialogs sequence + remove/adjust DEBUGMODE infos --- assets/DialogsLvl1.json | 13 ++++++++++++- src/config.h | 2 +- src/npc.c | 35 +++++++++++++++++++++-------------- 3 files changed, 34 insertions(+), 16 deletions(-) diff --git a/assets/DialogsLvl1.json b/assets/DialogsLvl1.json index e3e6b3a..c8e9ff5 100644 --- a/assets/DialogsLvl1.json +++ b/assets/DialogsLvl1.json @@ -7,7 +7,7 @@ "next1":-1, "conclusion2":"_", "next2":-1, - "nextOther":1 + "nextOther":3 }, { "ID":1, @@ -30,6 +30,17 @@ "conclusion2":"_", "next2":-1, "nextOther":-1 + }, + { + "ID":3, + "dialog":"Ce Hero de la Revolution a marque le pays de son Aura. Peut-etre aurais-je la meme destinee ... ", + "isQuestion":0, + "choice":"_", + "conclusion1":"_", + "next1":-1, + "conclusion2":"_", + "next2":-1, + "nextOther":-1 } ] } \ No newline at end of file diff --git a/src/config.h b/src/config.h index d84de0e..ed692b7 100644 --- a/src/config.h +++ b/src/config.h @@ -8,7 +8,7 @@ #define USB_FEATURE 0 -#define DEBUGMODE 1 +#define DEBUGMODE 0 #ifdef FXCG50 #define T_HEIGHT 16 diff --git a/src/npc.c b/src/npc.c index 071a538..01fea98 100644 --- a/src/npc.c +++ b/src/npc.c @@ -27,29 +27,35 @@ void npc_draw(Game *game) { { ExtraData *Data = &game->map_level->extradata[u]; + if (strcmp(Data->type, "NPC")==0) /* the current data is a NPC */ { /* TODO : This is for debugging purpose, JUste to render the path */ /* to be followed by the NPC when this will be implemented */ - if (Data->hasPath==1) /* this NPC has a trajectory */ - { - int NbPoints = Data->path_length+1; - for(int v=0; vhasPath==1) /* this NPC has a trajectory */ { + int NbPoints = Data->path_length+1; + for(int v=0; vx + Data->xpath[v % NbPoints]) * PXSIZE)-(int16_t) player->wx; + int16_t deltaY1=((int16_t) (Data->y + Data->ypath[v % NbPoints]) * PXSIZE)-(int16_t) player->wy; + + int16_t deltaX2=((int16_t) (Data->x + Data->xpath[(v+1) % NbPoints]) * PXSIZE)-(int16_t) player->wx; + int16_t deltaY2=((int16_t) (Data->y + Data->ypath[(v+1) % NbPoints]) * PXSIZE)-(int16_t) player->wy; - int16_t deltaX1=((int16_t) (Data->x + Data->xpath[v % NbPoints]) * PXSIZE)-(int16_t) player->wx; - int16_t deltaY1=((int16_t) (Data->y + Data->ypath[v % NbPoints]) * PXSIZE)-(int16_t) player->wy; - - int16_t deltaX2=((int16_t) (Data->x + Data->xpath[(v+1) % NbPoints]) * PXSIZE)-(int16_t) player->wx; - int16_t deltaY2=((int16_t) (Data->y + Data->ypath[(v+1) % NbPoints]) * PXSIZE)-(int16_t) player->wy; - - dline( player->px + deltaX1, player->py + deltaY1, - player->px + deltaX2, player->py + deltaY2, - PATH_COLOR); + dline( player->px + deltaX1, player->py + deltaY1, + player->px + deltaX2, player->py + deltaY2, + PATH_COLOR); + } } - } + + #endif // DEBUGMODE int16_t deltaX=((int16_t) (Data->x * PXSIZE))-(int16_t) player->wx; int16_t deltaY=((int16_t) (Data->y * PXSIZE))-(int16_t) player->wy; @@ -58,6 +64,7 @@ void npc_draw(Game *game) { &demo_PNJ_img); } + }