Very basic crash functionality
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -9,6 +9,9 @@
|
|||||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||||
<ApplicationIcon>Icon.ico</ApplicationIcon>
|
<ApplicationIcon>Icon.ico</ApplicationIcon>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||||
|
<OutputPath>d:\EvilSatellites\</OutputPath>
|
||||||
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Remove="Icon.ico" />
|
<None Remove="Icon.ico" />
|
||||||
<None Remove="Icon.bmp" />
|
<None Remove="Icon.bmp" />
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ namespace EvilSatellites.Objects
|
|||||||
var player = (Player)obj;
|
var player = (Player)obj;
|
||||||
if (player.Vacuuming)
|
if (player.Vacuuming)
|
||||||
{
|
{
|
||||||
player.CurrentWeapon.RemainingAmmo += rnd.Next(player.CurrentWeapon.MaxAmmo);
|
player.CurrentWeapon.Reload(rnd.Next(player.CurrentWeapon.MaxAmmo));
|
||||||
Destroy();
|
Destroy();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -203,6 +203,13 @@ namespace EvilSatellites.Objects
|
|||||||
}
|
}
|
||||||
dmgSound += "/int/" + (rnd.Next(2)+1).ToString()+".wav";
|
dmgSound += "/int/" + (rnd.Next(2)+1).ToString()+".wav";
|
||||||
Screen.Manager.Sound.PlayOneshot(dmgSound);
|
Screen.Manager.Sound.PlayOneshot(dmgSound);
|
||||||
|
if (Health < 1)
|
||||||
|
{
|
||||||
|
Destroy();
|
||||||
|
Screen.Manager.Sound.PlayOneshot(@"sfx/physics/crashes/1.wav");
|
||||||
|
System.Threading.Thread.Sleep(2000);
|
||||||
|
Environment.Exit(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void IncreaseHealth(float amount)
|
public void IncreaseHealth(float amount)
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ namespace EvilSatellites.Weapons
|
|||||||
Stopping
|
Stopping
|
||||||
}
|
}
|
||||||
|
|
||||||
public class AbstractWeapon : IWeapon
|
public abstract class AbstractWeapon : IWeapon
|
||||||
{
|
{
|
||||||
public IGameObject _wielder;
|
public IGameObject _wielder;
|
||||||
public float FireRate { get; set; }
|
public float FireRate { get; set; }
|
||||||
@@ -29,6 +29,6 @@ namespace EvilSatellites.Weapons
|
|||||||
public virtual void Reload() { }
|
public virtual void Reload() { }
|
||||||
public virtual void Stop() { }
|
public virtual void Stop() { }
|
||||||
public virtual void Update(GameTime time) { }
|
public virtual void Update(GameTime time) { }
|
||||||
|
public abstract void Reload(int amount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ namespace EvilSatellites.Weapons
|
|||||||
public interface IWeapon
|
public interface IWeapon
|
||||||
{
|
{
|
||||||
void Shoot(GameTime time);
|
void Shoot(GameTime time);
|
||||||
void Reload();
|
void Reload(int amount);
|
||||||
void Stop();
|
void Stop();
|
||||||
void Update(GameTime time);
|
void Update(GameTime time);
|
||||||
float FireRate { get; set; }
|
float FireRate { get; set; }
|
||||||
|
|||||||
@@ -113,5 +113,11 @@ namespace EvilSatellites.Weapons
|
|||||||
base.Update(time);
|
base.Update(time);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void Reload(int amount)
|
||||||
|
{
|
||||||
|
RemainingAmmo += amount;
|
||||||
|
sfxReload.Reset();
|
||||||
|
sfxReload.Play();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user