Esempio n. 1
0
        public override void HandleInput()
        {
            InputHelper input = game.inputManager.inputHelper;

            if (input.IsNewButtonPress(MouseButtons.LeftButton))
            {
                Vector2 position = ProjectionHelper.PixelToFarseer(input.MousePosition);

                List<Fixture> list = game.farseerManager.world.TestPointAll(position);

                LaserTurret t;

                if (list.Count == 0)
                    t = new LaserTurret(position, game.farseerManager.world, game.ragdollManager);
                else
                    t = new LaserTurret(position, game.farseerManager.world, game.ragdollManager, list[0]);

                game.hazardManager.addHazard(t);
                      
            }
        }
Esempio n. 2
0
        private void addTurret()
        {
            Turret t = new GunTurret(new Vector2(10, 0), world, game.ragdollManager);
            game.hazardManager.addHazard(t);

            Turret t2 = new LaserTurret(new Vector2(-10, 0), world, game.ragdollManager);
            game.hazardManager.addHazard(t2);
        }