public void CreateEchoWave(GameTime gt) { var currentTime = (float)gt.TotalGameTime.TotalMilliseconds / 1000; if (currentTime - lastEchoTime > echoCoolDown) { lastEchoTime = currentTime; var echoWave = new EchoWave(gt, new Vector2(X, Y)); echoWaves.Add(echoWave); echoWave.parent = this; echoWave.spriteBatch = spriteBatch; } }
public void CreateEchoWave(GameTime gt) { var currentTime = (float)gt.TotalGameTime.TotalMilliseconds / 1000; if (currentTime - lastEchoTime > echoCoolDown) { lastEchoTime = currentTime; var echoWave = new EchoWave(gt, new Vector2(X, Y)); echoWaves.Add(echoWave); echoWave.parent = this; echoWave.spriteBatch = spriteBatch; var castSound = GameContent.instance.echoCast.CreateInstance(); castSound.Volume = 0.2f; castSound.Play(); } }