Ejemplo n.º 1
0
        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);

        }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
 public void TestGetChatPad() {
   using (var manager = new InputManager()) {
     Assert.IsNotNull(manager.GetKeyboard(PlayerIndex.One));
   }
 }
Ejemplo n.º 4
0
 public void TestGetKeyboard() {
   using (var manager = new InputManager()) {
     Assert.IsNotNull(manager.GetKeyboard());
   }
 }
Ejemplo n.º 5
0
 public void TestGetChatPad()
 {
     using (var manager = new InputManager()) {
         Assert.IsNotNull(manager.GetKeyboard(PlayerIndex.One));
     }
 }
Ejemplo n.º 6
0
 public void TestGetKeyboard()
 {
     using (var manager = new InputManager()) {
         Assert.IsNotNull(manager.GetKeyboard());
     }
 }