i'm rendering an attack animation with the following code:
currentFrame = attackAnimation.getKeyFrame(stateTime, false); //3 : left, 2: right batch.draw(currentFrame, getX(), getY());
This renders the CurrentFrame on the x and y position of the character. This works fine for the right animation as you can see here:
but when i apply the same code for left for example it doesn't draw the character on the correct place and like "pushes himself away" from the bottom left corner and leaving the bounding box.
What am I doing wrong or what am I not seeing?
setGameObject(new Sprite(txtIdle)); setSize(getWidth(), getHeight()); setOrigin(getWidth() /2.0f, getHeight() /2.0f); setPosition(500, 500);
this code sets an idle image and the size of the bounding box (and the sprite)