Added sprite rotation and scale. Refactored bullet classes.

This commit is contained in:
2026-01-15 00:20:09 -05:00
parent 61d51f5188
commit 8e0a68efdf
25 changed files with 60 additions and 226 deletions

View File

@@ -8,7 +8,9 @@ public class Sprite(float x, float y)
public float XPosition { get; protected set; } = x;
public float YPosition { get; protected set; } = y;
public Vector2 Position => new(XPosition, YPosition);
public float Rotation { get; protected set; }
public Vector2 Origin { get; protected set; }
public Vector2 Scale { get; protected set; } = new(1, 1);
public Rectangle BoundBox { get; protected set; }
protected Rectangle CollisionBox;
@@ -31,7 +33,11 @@ public class Sprite(float x, float y)
public virtual void Draw(SpriteDrawArgs args)
{
//spriteBatch.Draw(Texture, Position, DrawColor);
DrawCollisionBox(args);
if (args.ShowCollisionBox)
{
DrawCollisionBox(args);
}
}
private void DrawCollisionBox(SpriteDrawArgs args)