public BadShooterViewModel(string name, double radius, IList<PlayerViewModel> players, ISoundEffect audioPlayer, IGunAimPhysics gunAimPhysics) { Name = name; Radius = radius; this.players = players; this.audioPlayer = audioPlayer; this.gunAimPhysics = gunAimPhysics; scores = players.ToDictionary(p => p.Key, p => 0); animationTimer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(10) }; animationTimer.Tick += DispatcherTimerOnTick; gameTimer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(1) }; gameTimer.Tick += CountDown; }
public void PlaySound(ISoundEffect sound) { if (null != sound) { ((XNASoundEffect)sound).Play(); } }
//protected IReset iReset; public GameScreenBase(Game game) { //iReset = game.Services.GetService(typeof(IReset)) as IReset; iHUD = game.Services.GetService(typeof(IHUD)) as IHUD; iPopUp = game.Services.GetService(typeof(IPopUpManager)) as IPopUpManager; World = new World(new Vector2(0, 30)); iSoundEffect = game.Services.GetService(typeof(ISoundEffect)) as ISoundEffect; iScrollingBackground = game.Services.GetService(typeof(IScrollingBackground)) as IScrollingBackground; iVisualiser = game.Services.GetService(typeof(IVisualiser)) as IVisualiser; }
public void PlaySE(ISoundEffect se, Transform transform) { if (se.Synced) { MusicManager.Instance.SyncedCall((beat) => PlayImmediate(se, transform)); } else { PlayImmediate(se, transform); } }
public Player(GameContext gameContext, IHealthComponent healthComponent, IComponent <IPlayer> inputComponent, IPlayerPhysicsComponent physicsComponent, IDrawableComponent <IPlayer> graphicsComponent, IProjectilesManager projectileManager) { _gameContext = gameContext ?? throw new ArgumentNullException(nameof(gameContext)); _inputComponent = inputComponent ?? throw new ArgumentNullException(nameof(inputComponent)); _healthComponent = healthComponent ?? throw new ArgumentNullException(nameof(healthComponent)); _physicsComponent = physicsComponent ?? throw new ArgumentNullException(nameof(physicsComponent)); _graphicsComponent = graphicsComponent ?? throw new ArgumentNullException(nameof(graphicsComponent)); _projectileManager = projectileManager ?? throw new ArgumentNullException(nameof(projectileManager)); _acceleratingSoundEffect = _gameContext.GameAudio.CreateSoundEffect(_gameContext.AssetManager.GetSoundEffect(GameConstants.ThrusterConstants.Thruster1Constants.Audio.ThrustingSoundEffectName)); _invulnerabilitySoundEffect = _gameContext.GameAudio.CreateSoundEffect(_gameContext.AssetManager.GetSoundEffect(GameConstants.PlayerConstants.Audio.InvulnerableSoundEffectName)); _invulnerableStopwatch = new Stopwatch(); _flashingStopwatch = new Stopwatch(); }
void PlayImmediate(ISoundEffect se, Transform transform) { if (!se.Exclusive && !se.Spacial) { UnSpacialSource.PlayOneShot(se.Clip, se.Volume); return; } if (se.Exclusive) { foreach (var s in sources) { if (s.soundEffect == se) { s.Stop(); } } } GetSESource().Play(se, transform); }
public async Task <(PlayResult, Task)> Play(IUser user, ISoundEffect sfx) { if (!_fs.File.Exists(sfx.Path)) { return(PlayResult.FileNotFound, Task.CompletedTask); } if (user is not IVoiceState vs) { return(PlayResult.UserNotInVoice, Task.CompletedTask); } var q = await _queueCollection.Get(vs.VoiceChannel.Guild.Id); await q.VoicePlayer.Move(vs.VoiceChannel); var finishedTask = await q.Enqueue(sfx, new AudioFileReader(sfx.Path)); return(PlayResult.Enqueued, finishedTask); }
public void Play() { if (false == this.missing) { if (null == this.soundEffect) { if (null != this.engine.Audio) { this.soundEffect = this.engine.Audio.LoadSound(this.Name); } } if (null == this.soundEffect) { this.missing = true; } else { this.engine.Audio.PlaySound(this.soundEffect); } } }
public static void BreakingBlockSoundEffect() { breakingBlockSoundEffect = new BrickBreakingEffect(); breakingBlockSoundEffect.Play(); }
public static void BlockBumpedEffect() { blockBumpedEffect = new BlockBumpEffect(); blockBumpedEffect.Play(); }
public static void SuperMarioJumpEffect() { superMarioJumpEffect = new SuperMarioJumpEffect(); superMarioJumpEffect.Play(); }
public static void StompEffect() { stompEffect = new StompEffect(); stompEffect.Play(); }
public static void SmallMarioJumpEffect() { smallMarioJumpEffect = new SmallMarioJumpEffect(); smallMarioJumpEffect.Play(); }
public void StopMusic() { ActiveSong?.Stop(); ActiveSong = null; }
public static void GoombaHitEffect() { goombaHitEffect = new GoombaStompedEffect(); goombaHitEffect.Play(); }
public static void FlagPoleEffect() { flagPoleEffect = new FlagPoleMovingEffect(); flagPoleEffect.Play(); }
public static void EnemyFlippedEffect() { enemyFlipped = new EnemyFlippedEffect(); enemyFlipped.Play(); }
public GameSound(GameContext context, ISoundEffect effect) { Context = context; Effect = effect; }
public void PlaySound(ISoundEffect sound) { var info = (SoundInfo)sound; info.SoundEffect.Play(); }
public static void CoinEffect() { coinEffect = new CoinEffect(); coinEffect.Play(); }
public static void PacExtraLifeEffect() { pacExtraLifeEffect = new PacMarioExtraLifeEffect(); pacExtraLifeEffect.Play(); }
public static void EatGhostEffect() { eatGhostEffect = new EatGhostEffect(); eatGhostEffect.Play(); }
public void Stop() { soundEffect = null; audioSource.Stop(); }
public static void FireBallThrowEffect() { fireBallThrowEffect = new FireballEffect(); fireBallThrowEffect.Play(); }
public static void PacMarioChompEffect() { pacMarioChompEffect = new PacMarioChompEffect(); pacMarioChompEffect.Play(); }
public static void GameOverEffect() { gameOverEffect = new GameOverEffect(); gameOverEffect.Play(); }
public static void PowerPlayerUpEffect() { powerPlayerUpEffect = new PowerPlayerUpEffect(); powerPlayerUpEffect.Play(); }
public static void OneUpEffect() { oneUpEffect = new OneUpEffect(); oneUpEffect.Play(); }
public static void PowerUpAppearsEffect() { powerUpAppearsEffect = new PowerUpAppearsEffect(); powerUpAppearsEffect.Play(); }
public abstract ISoundEffect PlaySoundEffect(ISoundEffect isfx, bool repeat = false);
public static void ShrinkingOrPipeEffect() { shrinkingOrPipeEffect = new ShrinkingOrPipeEffect(); shrinkingOrPipeEffect.Play(); }