Smoother NPC movement

This commit is contained in:
mibi88 2024-07-31 14:46:39 +02:00
parent 490fceca25
commit aa448c4dc6

View file

@ -267,10 +267,8 @@ void npc_draw(Game *game) {
}
#endif // DEBUGMODE
int16_t delX =
((int16_t)((Data->curx >> PRECISION) * PXSIZE)) - (int16_t)pl->wx;
int16_t delY =
((int16_t)((Data->cury >> PRECISION) * PXSIZE)) - (int16_t)pl->wy;
int16_t delX = ((Data->curx * PXSIZE)>>PRECISION) - (int16_t)pl->wx;
int16_t delY = ((Data->cury * PXSIZE)>>PRECISION) - (int16_t)pl->wy;
bopti_image_t *face = npc_sprites[Data->face];
dimage(pl->px - P_WIDTH / 2 + delX, pl->py - P_HEIGHT / 2 + delY, face);
}