public void SpawnBomb(Vetbol vetbol, Vector2 direction) { FatBomb bomb = this.BombPool.New(); direction.Y *= -1; bomb.Velocity = direction * 1200; bomb.Position = vetbol.Position; bomb.Activate(vetbol); }
private FatBomb NewBomb() { FatBomb bomb = new FatBomb(); bomb.Deactivate(); this.AddChild(bomb); return(bomb); }
public void ExplodeBomb(FatBomb bomb) { soundEffectBomb.Play(); int width = 186; int height = 186; BoundingRectangle rect = new BoundingRectangle((int)bomb.Position.X - width / 2, (int)bomb.Position.Y - height / 2, width, height); foreach (Vetbol player in this.players) { if (player.GetBoundingBox().Intersects(rect) && !player.IsFlickering) { Controller.Input.SetVibrationWithTimer(player.index, TimeSpan.FromMilliseconds(300)); player.Deactivate(); if (!respawnTimers.ContainsKey(player)) { respawnTimers.Add(player, respawnTime); } hud.PlayerDied(player); } } }
private FatBomb NewBomb() { FatBomb bomb = new FatBomb(); bomb.Deactivate(); this.AddChild(bomb); return bomb; }
public void ExplodeBomb(FatBomb bomb) { soundEffectBomb.Play(); int width = 186; int height = 186; BoundingRectangle rect = new BoundingRectangle((int)bomb.Position.X - width / 2, (int)bomb.Position.Y - height / 2, width, height); foreach (Vetbol player in this.players) { if (player.GetBoundingBox().Intersects(rect) && !player.IsFlickering) { Controller.Input.SetVibrationWithTimer(player.index, TimeSpan.FromMilliseconds(300)); player.Deactivate(); if(!respawnTimers.ContainsKey(player)) respawnTimers.Add(player, respawnTime); hud.PlayerDied(player); } } }