Initial main menu impl

This commit is contained in:
2021-04-23 15:07:50 +02:00
parent 05657b14dd
commit 44f0f9e399
10 changed files with 91 additions and 38 deletions
+7 -7
View File
@@ -56,7 +56,7 @@ namespace EvilSatellites.Weapons
State = WeaponState.Starting;
sfxSpinup.Reset();
sfxSpinup.Play();
TimerStart = time.TotalGameTime.TotalMilliseconds;
TimerStart = 0;
}
public override void Stop()
@@ -73,19 +73,19 @@ namespace EvilSatellites.Weapons
public override void Update(GameTime time)
{
TimerEnd += time.ElapsedGameTime.TotalMilliseconds;
TimerStart += time.ElapsedGameTime.TotalMilliseconds;
if (State == WeaponState.Starting)
{
if (TimerEnd - TimerStart > 800)
if (TimerStart > 800)
{
State = WeaponState.Firing;
sfxSpinning.Play();
TimerStart = TimerEnd;
TimerStart = 0;
}
}
if (State == WeaponState.Firing)
{
if (TimerEnd - TimerStart > FireRate)
if (TimerStart > FireRate)
{
if (RemainingAmmo > 0)
{
@@ -104,10 +104,10 @@ namespace EvilSatellites.Weapons
}
if (State == WeaponState.Stopping)
{
if (TimerEnd - TimerStart > 500)
if (TimerStart > 500)
{
State = WeaponState.Stopped;
TimerStart = TimerEnd;
TimerStart = 0;
}
}
base.Update(time);