Add project files.

This commit is contained in:
2025-12-16 08:51:34 -05:00
parent ed4d50a5bd
commit f7e3fe0a47
140 changed files with 2946 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace AlienAttack.MonoGame.Things;
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 Rectangle BoundBox { get; protected set; }
protected Rectangle CollisionBox;
protected Color DrawColor = Color.White;
public bool CanCollide { get; protected set; } = true;
public bool IsDead { get; protected set; }
public virtual void Update(SpriteUpdateContext context)
{
CollisionBox = new Rectangle((int)XPosition + BoundBox.X, (int)YPosition + BoundBox.Y, BoundBox.Width, BoundBox.Height);
}
public bool Intersects(Sprite sprite)
{
return CollisionBox.Intersects(sprite.CollisionBox);
}
public virtual void Draw(SpriteDrawArgs args)
{
//spriteBatch.Draw(Texture, Position, DrawColor);
}
public virtual void OnCollision(SpriteCollisionContext context)
{
}
}