x/y pos now centered
This commit is contained in:
@@ -20,10 +20,10 @@ public class LivingEntity extends Entity {
|
||||
} else if (velX > 0) {
|
||||
side = false;
|
||||
}
|
||||
int offsetX = (int) ((width * Tile.getSize()) / 2 - (actionFigur.getBreite()) / 2);
|
||||
int offsetY = (int) ((height * Tile.getSize()) / 2 - (actionFigur.getHoehe()) / 2);
|
||||
actionFigur.positionSetzen(posX * Tile.getSize() + offsetX + spriteOffsetX * Tile.getSize(),
|
||||
posY * Tile.getSize() + offsetY + spriteOffsetY * Tile.getSize());
|
||||
int offsetX = (int) ((width * Tile.getSize()) / 2 - (actionFigur.getBreite()) / 2 + spriteOffsetX * Tile.getSize() - (width * Tile.getSize()) / 2);
|
||||
int offsetY = (int) ((height * Tile.getSize()) / 2 - (actionFigur.getHoehe()) / 2 + spriteOffsetY * Tile.getSize() - (height * Tile.getSize()) / 2);
|
||||
actionFigur.positionSetzen(posX * Tile.getSize() + offsetX,
|
||||
posY * Tile.getSize() + offsetY);
|
||||
}
|
||||
|
||||
protected void moveLeft() {
|
||||
|
||||
Reference in New Issue
Block a user