mirror of
https://git.planet-casio.com/Slyvtt/Collab_RPG.git
synced 2024-12-29 13:03:43 +01:00
Fixed NPCs path alignement and importation (thanks Lephé)
This commit is contained in:
parent
8a7a09d960
commit
db2880dc8f
2 changed files with 3 additions and 4 deletions
|
@ -32,7 +32,7 @@ extern Map *worldRPG[];
|
||||||
/* Game data (defined in "game.h")*/
|
/* Game data (defined in "game.h")*/
|
||||||
Game game = {
|
Game game = {
|
||||||
NULL,
|
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
|
false, false, false, 0
|
||||||
|
|
||||||
/* debug variables*/
|
/* debug variables*/
|
||||||
|
|
|
@ -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 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;
|
int16_t deltaY1=((int16_t) (Data->y + 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 deltaX2=((int16_t) (Data->x + Data->xpath[(v+1) % NbPoints]) * PXSIZE)-(int16_t) player->wx;
|
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,
|
dline( player->px + deltaX1, player->py + deltaY1,
|
||||||
player->px + deltaX2, player->py + deltaY2,
|
player->px + deltaX2, player->py + deltaY2,
|
||||||
|
|
Loading…
Reference in a new issue