コード例 #1
0
        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);
        }
コード例 #2
0
        private FatBomb NewBomb()
        {
            FatBomb bomb = new FatBomb();

            bomb.Deactivate();
            this.AddChild(bomb);

            return(bomb);
        }
コード例 #3
0
        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);
                }
            }
        }
コード例 #4
0
        private FatBomb NewBomb()
        {
            FatBomb bomb = new FatBomb();
            bomb.Deactivate();
            this.AddChild(bomb);

            return bomb;
        }
コード例 #5
0
        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);
                }
            }
        }