Added HUD drawing logic.
This commit is contained in:
6
AlientAttack.MonoGame/Things/Enemies/EnemyShip.cs
Normal file
6
AlientAttack.MonoGame/Things/Enemies/EnemyShip.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace AlienAttack.MonoGame.Things.Enemies;
|
||||
|
||||
public abstract class EnemyShip(int x, int y) : MoveableSprite(x, y)
|
||||
{
|
||||
public virtual int CrashDamage => 10;
|
||||
}
|
||||
@@ -9,7 +9,7 @@ using System.Collections.Generic;
|
||||
|
||||
namespace AlienAttack.MonoGame.Things.Enemies;
|
||||
|
||||
internal class GreenEnemy : MoveableSprite
|
||||
internal class GreenEnemy : EnemyShip
|
||||
{
|
||||
//Enemy01_Green_Frame_1_png_processed
|
||||
|
||||
@@ -113,5 +113,10 @@ internal class GreenEnemy : MoveableSprite
|
||||
{
|
||||
Health -= bullet.Damage;
|
||||
}
|
||||
|
||||
if (context.Sprite is Player)
|
||||
{
|
||||
Health = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ using Microsoft.Xna.Framework.Graphics;
|
||||
|
||||
namespace AlienAttack.MonoGame.Things.Enemies;
|
||||
|
||||
internal class RedEnemy : MoveableSprite
|
||||
internal class RedEnemy : EnemyShip
|
||||
{
|
||||
protected int FireThreshold => 20;
|
||||
protected int CurrentFireThreshold { get; set; } = 20;
|
||||
@@ -92,5 +92,10 @@ internal class RedEnemy : MoveableSprite
|
||||
{
|
||||
Health -= bullet.Damage;
|
||||
}
|
||||
|
||||
if (context.Sprite is Player)
|
||||
{
|
||||
Health = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ using Microsoft.Xna.Framework.Graphics;
|
||||
|
||||
namespace AlienAttack.MonoGame.Things.Enemies;
|
||||
|
||||
internal class TealEnemy : MoveableSprite
|
||||
internal class TealEnemy : EnemyShip
|
||||
{
|
||||
protected int FireThreshold => 20;
|
||||
protected int CurrentFireThreshold { get; set; } = 20;
|
||||
@@ -85,5 +85,10 @@ internal class TealEnemy : MoveableSprite
|
||||
{
|
||||
Health -= bullet.Damage;
|
||||
}
|
||||
|
||||
if (context.Sprite is Player)
|
||||
{
|
||||
Health = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user