Added texture cache and sprite origins.

This commit is contained in:
2026-01-14 23:09:13 -05:00
parent fcb4f1cf05
commit 61d51f5188
36 changed files with 319 additions and 83 deletions

View File

@@ -7,7 +7,7 @@ public static class MuzzleMath
public static Vector2 GetMuzzleWorld(Sprite owner, Vector2 muzzleLocalPx, float ownerScale = 1f)
{
// Assumes owner.Position is the top-left of the sprite
return owner.Position + muzzleLocalPx * ownerScale;
return owner.Position - owner.Origin + muzzleLocalPx * ownerScale;
}
public static Vector2 CenterBulletOn(Vector2 muzzleWorld, int bulletW, int bulletH)