diff --git a/app/main.c b/app/main.c index 977bec1..699cca5 100644 --- a/app/main.c +++ b/app/main.c @@ -265,11 +265,11 @@ int main(int argc, char *argv[]) } // Draw player - const unsigned piframe = (t / BASEANIMPERIOD) % PIANIMLEN; - psrc.x = PIWIDTH * piframe; - pdest.x = SCALE * (int)(ppos.x - vpos.x); - pdest.y = SCALE * (int)(ppos.y - vpos.y); - SDL_RenderCopy(renderer, pitex, &psrc, &pdest); + const unsigned piframe = (t / BASEANIMPERIOD) % PANIMLEN; + psrc.x = PWIDTH * piframe; + pdest.x = SCALE * (int)(ppos.x - vpos.x - PWIDTH / 2); + pdest.y = SCALE * (int)(ppos.y - vpos.y - PHEIGHT / 2); + SDL_RenderCopy(renderer, pidle, &psrc, &pdest); SDL_RenderPresent(renderer); }