diff --git a/src/main.c b/src/main.c index 5d1cc83..9b977be 100644 --- a/src/main.c +++ b/src/main.c @@ -32,7 +32,7 @@ extern Map *worldRPG[]; /* Game data (defined in "game.h")*/ Game game = { NULL, - {12*PXSIZE, 36*PXSIZE, 0, 0, 10*PXSIZE, 48*PXSIZE, 100, SPEED, false, 0, false}, + {12*PXSIZE, 36*PXSIZE, 0, 0, 12*PXSIZE, 36*PXSIZE, 100, SPEED, false, 0, false}, false, false, false, 0 /* debug variables*/ diff --git a/src/npc.c b/src/npc.c index d316a52..148c06c 100644 --- a/src/npc.c +++ b/src/npc.c @@ -40,11 +40,10 @@ void npc_draw(Game *game) { int16_t deltaX1=((int16_t) (Data->x + Data->xpath[v % NbPoints]) * PXSIZE)-(int16_t) player->wx; - int16_t deltaY1=((int16_t) (Data->x + Data->ypath[v % NbPoints]) * PXSIZE)-(int16_t) player->wy; - /*DEBUG*/ dprint(0, 0, 0xFAFA, "coucou 43 : %d", v); dupdate(); getkey(); //plante avant ici (le v % NbPoints est sus) + 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->x + Data->ypath[(v+1) % NbPoints]) * PXSIZE)-(int16_t) player->wy; + 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,