private void PlayGatherSound() { int soundFile = random.Next(1, 3); gatherSound = new BaseSound(Game, $"Sounds/gather{soundFile}"); gatherSound.PlaySound(0.9f); }
private void PlayFootStepSound() { int soundFile = random.Next(0, 10); gatherSound = new BaseSound(Game, $"Sounds/footstep0{soundFile}"); gatherSound.PlaySound(0.2f); }
public override void Initialize() { countdown = new BaseSound(Game, "Sounds/1"); RemainingTime = TIMER_MAX_TIME; timerText = new MovingText(Game, "Fonts/regularfont", $"{RemainingTime}", new Vector2(Game.GraphicsDevice.Viewport.Width / 2, 10), Color.White); Game.Services.GetService <GameplayScene>().SceneComponents.Add(timerText); Game.Components.Add(timerText); base.Initialize(); }
/// <summary> /// Checks if the passed box collider is touching with players collider for item insertion /// </summary> private void InsertItemsFromHandToBox(CollectionBoxes box) { if (InventoryItem.InventoryItems > 0) { foreach (GameComponent component in itemsInInventory) { if (component is InventoryItem) { // we have to cycle through scene componnents to find out which box box.Insert(component); Game.Components.Remove(component); insertSound = new BaseSound(Game, "Sounds/insert"); insertSound.PlaySound(0.02f); } } // We reset the static varaible in the inventory item class so it draws on the correct position in screen Game.Services.GetService <ScoreManager>().CalculateScore(box); InventoryItem.InventoryItems = 0; itemsInInventory = new List <GameComponent>(); } }
private void PlayCountDownSounds(int second) { countdown = new BaseSound(Game, $"Sounds/{second}"); countdown.PlaySound(0.5f); }