Added sprite rotation and scale. Refactored bullet classes.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user