Beispiel #1
0
        private void _testPhysic()
        {
            if (!Environment.GetCommandLineArgs().Contains("physic"))
            {
                return;
            }

            if (!IsPressed(VirtualKeyStates.Return))
            {
                return;
            }

            if (!Ball.IsFlying)
            {
                return;
            }

            Ball = new Ball(Info);
            Ball.Load();
            Ball.Position = Position;
            Info.AddUnit(Ball);
        }
        public override void Collided(BaseUnit baseUnit)
        {
            if (baseUnit.UnitType == UnitType.Ball)
            {
                if (_hitsToDestroy == 1)
                {
                    Info.RemoveUnit(this);

                    if (_isBonus)
                    {
                        Bonus bonus = new Bonus(Info);
                        bonus.Load();
                        bonus.Position = new Point(Position.X, Position.Y);

                        Info.AddUnit(bonus);
                    }
                }
                else
                {
                    _Reload(--_hitsToDestroy);
                }
            }
        }