Take and replenish health and ammo
This commit is contained in:
@@ -56,6 +56,8 @@ namespace EvilSatellites.Objects
|
||||
var player = (Player)obj;
|
||||
if (player.Vacuuming)
|
||||
{
|
||||
player.CurrentWeapon.RemainingAmmo += rnd.Next(player.CurrentWeapon.MaxAmmo);
|
||||
Destroy();
|
||||
return;
|
||||
}
|
||||
player.TakeDamage(25);
|
||||
|
||||
@@ -103,6 +103,10 @@ namespace EvilSatellites.Objects
|
||||
sfxTurn.Update(gameTime);
|
||||
sfxElevator.Update(gameTime);
|
||||
sfxVacuum.Update(gameTime);
|
||||
if (Health < 100)
|
||||
{
|
||||
IncreaseHealth(0.01f);
|
||||
}
|
||||
if (Movement.Length() != 0)
|
||||
{
|
||||
if (Movement.X > 0)
|
||||
@@ -201,6 +205,16 @@ namespace EvilSatellites.Objects
|
||||
Screen.Manager.Sound.PlayOneshot(dmgSound);
|
||||
}
|
||||
|
||||
public void IncreaseHealth(float amount)
|
||||
{
|
||||
Health += amount;
|
||||
if (Health > 25 && IsDamaged)
|
||||
{
|
||||
IsDamaged = false;
|
||||
sfxDamage.Pause();
|
||||
}
|
||||
}
|
||||
|
||||
public void PlayTap()
|
||||
{
|
||||
sfxTaps.Play();
|
||||
|
||||
Reference in New Issue
Block a user