示例#1
0
        public GameManager(World UIWorld, Game game)
            : base(UIWorld)
        {
            this.game = game;

            // Create managers
            menuManager  = new MenuManager(this);
            landManager  = new LandManager(this);
            fightManager = new FightManager(this);
            gameState    = gameManagerState.inMenu;


            //Create player
            Dictionary <ActionKeyType, Keys> keyMapping = new Dictionary <ActionKeyType, Keys>();

            keyMapping.Add(ActionKeyType.Up, Keys.W);
            keyMapping.Add(ActionKeyType.Down, Keys.S);
            keyMapping.Add(ActionKeyType.Right, Keys.D);
            keyMapping.Add(ActionKeyType.Left, Keys.A);
            keyMapping.Add(ActionKeyType.Space, Keys.Space);
            player1 = new LocalPlayer(keyMapping);
            PlayerManager.addPlayer(player1, "player1");


            //UserInterfaceManager.createNewUserInterfaceArea(new Vector2(Graphics.resolution.X - 200, Graphics.resolution.Y), new Vector2((Graphics.resolution.X/2f - 200f)/2f, 0), "activebox");
            UserInterfaceManager.createNewUserInterfaceArea(new Rectangle(200, 0, Graphics.resolution.X - 200, Graphics.resolution.Y), "activebox");
        }
示例#2
0
        public GameManager(World UIWorld, Game game)
            : base(UIWorld)
        {
            this.game = game;

            // Create managers
            menuManager = new MenuManager(this);
            landManager = new LandManager(this);
            fightManager = new FightManager(this);
            gameState = gameManagerState.inMenu;

            //Create player
            Dictionary<ActionKeyType, Keys> keyMapping = new Dictionary<ActionKeyType,Keys>();
            keyMapping.Add(ActionKeyType.Up, Keys.W);
            keyMapping.Add(ActionKeyType.Down, Keys.S);
            keyMapping.Add(ActionKeyType.Right, Keys.D);
            keyMapping.Add(ActionKeyType.Left, Keys.A);
            keyMapping.Add(ActionKeyType.Space, Keys.Space);
            player1 = new LocalPlayer(keyMapping);
            PlayerManager.addPlayer(player1, "player1");

            //UserInterfaceManager.createNewUserInterfaceArea(new Vector2(Graphics.resolution.X - 200, Graphics.resolution.Y), new Vector2((Graphics.resolution.X/2f - 200f)/2f, 0), "activebox");
            UserInterfaceManager.createNewUserInterfaceArea(new Rectangle(200, 0, Graphics.resolution.X - 200, Graphics.resolution.Y), "activebox");
        }