Added configurable weapons.

This commit is contained in:
2026-01-03 21:49:27 -05:00
parent 79fd63c3ce
commit e8e31bb143
37 changed files with 332 additions and 88 deletions

View File

@@ -4,7 +4,7 @@ using System;
namespace AlienAttack.MonoGame.Things.Items;
internal abstract class Item : MoveableSprite
public abstract class Item : MoveableSprite
{
private Vector2 _anchor; // the "center" the item orbits around
private float _t; // radians
@@ -59,13 +59,10 @@ internal abstract class Item : MoveableSprite
public override void OnCollision(SpriteCollisionContext context)
{
if (context.Sprite is Player player)
if (context.Sprite is Player)
{
IsDead = true;
ApplyEffect(player);
context.AudioManager.PlayPickup(Kind);
}
}
protected abstract void ApplyEffect(Player player);
}