Added configurable weapons.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
namespace AlienAttack.MonoGame.Things.Items;
|
||||
|
||||
internal class Ammo : Item
|
||||
public class Ammo : Item
|
||||
{
|
||||
protected override PickupKind Kind => PickupKind.Ammo;
|
||||
|
||||
@@ -8,9 +8,4 @@ internal class Ammo : Item
|
||||
{
|
||||
TextureName = @$"Sprites\Powerup_Ammo";
|
||||
}
|
||||
|
||||
protected override void ApplyEffect(Player player)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace AlienAttack.MonoGame.Things.Items;
|
||||
|
||||
internal class Energy : Item
|
||||
public class Energy : Item
|
||||
{
|
||||
protected override PickupKind Kind => PickupKind.Plasma;
|
||||
|
||||
@@ -8,9 +8,4 @@ internal class Energy : Item
|
||||
{
|
||||
TextureName = @$"Sprites\Powerup_Energy";
|
||||
}
|
||||
|
||||
protected override void ApplyEffect(Player player)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace AlienAttack.MonoGame.Things.Items;
|
||||
|
||||
internal class Health : Item
|
||||
public class Health : Item
|
||||
{
|
||||
protected override PickupKind Kind => PickupKind.Health;
|
||||
|
||||
@@ -8,9 +8,4 @@ internal class Health : Item
|
||||
{
|
||||
TextureName = @$"Sprites\Powerup_Health";
|
||||
}
|
||||
|
||||
protected override void ApplyEffect(Player player)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace AlienAttack.MonoGame.Things.Items;
|
||||
|
||||
internal class Rockets : Item
|
||||
public class Rockets : Item
|
||||
{
|
||||
protected override PickupKind Kind => PickupKind.Rockets;
|
||||
|
||||
@@ -8,9 +8,4 @@ internal class Rockets : Item
|
||||
{
|
||||
TextureName = @$"Sprites\Powerup_Rockets";
|
||||
}
|
||||
|
||||
protected override void ApplyEffect(Player player)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace AlienAttack.MonoGame.Things.Items;
|
||||
|
||||
internal class Shields : Item
|
||||
public class Shields : Item
|
||||
{
|
||||
protected override PickupKind Kind => PickupKind.Shield;
|
||||
|
||||
@@ -8,9 +8,4 @@ internal class Shields : Item
|
||||
{
|
||||
TextureName = @$"Sprites\Powerup_Shields";
|
||||
}
|
||||
|
||||
protected override void ApplyEffect(Player player)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user