diff --git a/res/objecttypes.xml b/res/objecttypes.xml index 59110f6..92b4504 100644 --- a/res/objecttypes.xml +++ b/res/objecttypes.xml @@ -1,9 +1,10 @@ - + + - - + + @@ -24,4 +25,4 @@ - \ No newline at end of file + diff --git a/src/model/HitboxRectangle.java b/src/model/HitboxRectangle.java index 3e0f58a..3cab2ec 100644 --- a/src/model/HitboxRectangle.java +++ b/src/model/HitboxRectangle.java @@ -108,7 +108,10 @@ public class HitboxRectangle extends Hitbox { bottomPoint.y=currentPoint.y; } } - referencePoint.x = bottomPoint.x-owner.getImage().getWidth()/2; - referencePoint.y = bottomPoint.y-owner.getImage().getHeight(); + bottomPoint = isometricToCartesian(bottomPoint.x,bottomPoint.y,bottomPoint); + Point cartesianCenterImagePoint= new Point(0,0); + cartesianCenterImagePoint = isometricToCartesian(owner.getImage().getWidth()/2,owner.getImage().getHeight(),cartesianCenterImagePoint); + referencePoint.x = cartesianCenterImagePoint.x-bottomPoint.x; + referencePoint.y = cartesianCenterImagePoint.y-bottomPoint.y; } }