Esempio n. 1
0
        public LevelEditor()
        {
            //InputHelper.AddKey(Keys.Q);
            //InputHelper.AddKey(Keys.W);

            // just add all keys
            Keys[] allKeys = (Keys[])Enum.GetValues(typeof(Keys));
            foreach (var key in allKeys)
            {
                InputHelper.AddKey(key);
            }

            InputHelper.KeyRelease += new KeyHandler(KeyboardInput_KeyRelease);
            InputHelper.MouseMove  += new MouseMoveHandler(MouseInput_MouseMove);
            InputHelper.MouseDown  += new MouseClickHandler(MouseInput_MouseDown);
            InputHelper.MouseUp    += new MouseClickHandler(MouseInput_MouseUp);

            // tst actor navigation
            // Create behavior and the actor
            nav              = new BehaviorNav(0.2f);
            nav.GoalReached += new EventHandler(nav_GoalReached);

            bot          = new Actor("AI/arrow", Color.White);
            bot.Position = new Vector2(0, -380);
            bot.BehaviorList.Add(nav);
        } // LevelEditor()