Initial main menu impl
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user