Added configurable weapons.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user