public AngryTanks() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; // increase update rate to 120 Hz IsFixedTimeStep = true; TargetElapsedTime = new TimeSpan(0, 0, 0, 0, (int)(1000 / 120)); // instantiate server link serverLink = new ServerLink(); // get GameStateManager up and running gameStateManager = new GameStateManager(Services); Components.Add(gameStateManager); gameStateManager.UpdateOrder = 200; gameStateManager.DrawOrder = 200; // down with xna's input! input = new InputManager(Services, Window.Handle); Components.Add(input); input.UpdateOrder = 100; input.GetKeyboard().KeyPressed += HandleKeyPress; // instantiate world world = new World(Services, serverLink); world.UpdateOrder = 500; world.DrawOrder = 500; Components.Add(world); // instantiate game console gameConsole = new GameConsole(this, new Vector2(0, 400), new Vector2(800, 200), new Vector2(10, 10), new Vector2(10, 10), new Color(255, 255, 255, 100)); Components.Add(gameConsole); gameConsole.UpdateOrder = 1000; gameConsole.DrawOrder = 1000; gameConsole.PromptReceivedInput += HandlePromptInput; // instantiate AudioManager audioManager = new AudioManager(this); }
public User(Game game, Ecosystem ecosystem) { this.ecosystem = ecosystem; this.game = game; this.baseGame = (CircleOfLifeGame)game; //Initialize Nuclex Managers state = new Nuclex.Game.States.GameStateManager(game.Services); input = new InputManager(game.Services); gui = new GuiManager(game.Services); //Add nuclex managers to game components game.Components.Add(state); game.Components.Add(input); game.Components.Add(gui); //initialize input device objects keyboard = input.GetKeyboard(); mouse = input.GetMouse(); hudDestination = new Rectangle(0, (int)(baseGame.graphics.PreferredBackBufferHeight * 0.9f), baseGame.graphics.PreferredBackBufferWidth, (int)(baseGame.graphics.PreferredBackBufferHeight * 0.1f)); //meh Initialize(); }
public void TestGetChatPad() { using (var manager = new InputManager()) { Assert.IsNotNull(manager.GetKeyboard(PlayerIndex.One)); } }
public void TestGetKeyboard() { using (var manager = new InputManager()) { Assert.IsNotNull(manager.GetKeyboard()); } }