Exemple #1
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here
            this.IsMouseVisible = true;
            Font1 = Content.Load <SpriteFont>("SpriteFont1");
            // Create Scenario
            this.testScenario = new ZRTSModel.Scenario.Scenario(20, 20);


            // The most challenging obstacles
            //createTestGameWorld();

            // Empty Map
            //createEmptyTestGameWorld();

            // Simulating gameplay
            createTestGameWorldSimulateBuildings();

            // Controller
            this.testGameController = new ZRTSLogic.Controller(this.testScenario);

            // Dummy unit
            //this.testScenario.getGameWorld().getUnits().Add(new ZRTSModel.Entities.Unit(0, 20, 100, 50, 0));
            /** NOTE: Adding Entities should be done through the Controller from now on **/
            this.testGameController.addUnit(new ZRTSModel.Entities.Unit(testGameController.scenario.getWorldPlayer(), 20, 100, 50, 0), 5, 10);
            this.testGameController.addUnit(new ZRTSModel.Entities.Unit(testGameController.scenario.getWorldPlayer(), 20, 100, 50, 0), 10, 5);
            this.testGameController.addUnit(new ZRTSModel.Entities.Unit(testGameController.scenario.getWorldPlayer(), 20, 100, 50, 0), 15, 10);

            input          = new MouseState();
            prevInput      = input;
            gameSelectView = new ViewSelect();
            base.Initialize();
        }
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here
            this.IsMouseVisible = true;
            Font1 = Content.Load <SpriteFont>("SpriteFont1");

            // Create Scenario
            this.testScenario = new ZRTSModel.Scenario.Scenario(graphics.PreferredBackBufferWidth / 20, 20);

            // The most challenging obstacles
            //createTestGameWorld();

            // Empty Map
            //createEmptyTestGameWorld();

            // Simulating gameplay
            createTestGameWorldSimulateBuildings();


            // Controller
            this.testGameController = new ZRTSLogic.Controller(this.testScenario);

            // Dummy unit
            //this.testScenario.getGameWorld().getUnits().Add(new ZRTSModel.Entities.Unit(0, 20, 100, 50, 0));
            /** NOTE: Adding Entities should be done through the Controller from now on **/
            //this.testGameController.addUnit(new ZRTSModel.Entities.Unit(testGameController.scenario.getWorldPlayer(), 20, 100, 50, 0), 5, 10);
            ZRTSModel.Entities.Unit unit1 = new ZRTSModel.Entities.Unit(testGameController.scenario.getPlayer(), 100);
            ZRTSModel.Entities.Unit unit2 = new ZRTSModel.Entities.Unit(testGameController.scenario.getZombiePlayer(), 100);
            this.testGameController.addUnit(unit1, 10, 5);
            this.testGameController.addUnit(unit2, 20, 10);
            unit2.setAttackStance(ZRTSModel.Entities.Unit.AttackStance.Agressive);
            unit1.setAttackStance(ZRTSModel.Entities.Unit.AttackStance.Guard);


            testGameController.scenario.getPlayer().player_resources[0] = 300;
            testGameController.scenario.getPlayer().player_resources[1] = 300;
            testGameController.scenario.getPlayer().player_resources[2] = 300;
            testGameController.scenario.getPlayer().player_resources[3] = 300;

            input     = new MouseState();
            prevInput = input;

            gameSelectView = new ViewSelect();
            base.Initialize();
        }
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here
            this.IsMouseVisible = true;
            Font1 = Content.Load<SpriteFont>("SpriteFont1");
            // Create Scenario
            this.testScenario = new ZRTSModel.Scenario.Scenario(20, 20);

            // The most challenging obstacles
            //createTestGameWorld();

            // Empty Map
            //createEmptyTestGameWorld();

            // Simulating gameplay
            createTestGameWorldSimulateBuildings();

            // Controller
            this.testGameController = new ZRTSLogic.Controller(this.testScenario);

            // Dummy unit
            //this.testScenario.getGameWorld().getUnits().Add(new ZRTSModel.Entities.Unit(0, 20, 100, 50, 0));
            /** NOTE: Adding Entities should be done through the Controller from now on **/
            this.testGameController.addUnit(new ZRTSModel.Entities.Unit(testGameController.scenario.getWorldPlayer(), 20, 100, 50, 0), 5, 10);
            this.testGameController.addUnit(new ZRTSModel.Entities.Unit(testGameController.scenario.getWorldPlayer(), 20, 100, 50, 0), 10, 5);
            this.testGameController.addUnit(new ZRTSModel.Entities.Unit(testGameController.scenario.getWorldPlayer(), 20, 100, 50, 0), 15, 10);

            input = new MouseState();
            prevInput = input;
            gameSelectView = new ViewSelect();
            base.Initialize();
        }
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here
            this.IsMouseVisible = true;
            Font1 = Content.Load<SpriteFont>("SpriteFont1");

            // Create Scenario
            this.testScenario = new ZRTSModel.Scenario.Scenario(graphics.PreferredBackBufferWidth/20, 20);

            // The most challenging obstacles
            //createTestGameWorld();

            // Empty Map
            //createEmptyTestGameWorld();

            // Simulating gameplay
            createTestGameWorldSimulateBuildings();

            // Controller
            this.testGameController = new ZRTSLogic.Controller(this.testScenario);

            // Dummy unit
            //this.testScenario.getGameWorld().getUnits().Add(new ZRTSModel.Entities.Unit(0, 20, 100, 50, 0));
            /** NOTE: Adding Entities should be done through the Controller from now on **/
            //this.testGameController.addUnit(new ZRTSModel.Entities.Unit(testGameController.scenario.getWorldPlayer(), 20, 100, 50, 0), 5, 10);
            ZRTSModel.Entities.Unit unit1 = new ZRTSModel.Entities.Unit(testGameController.scenario.getPlayer(), 100);
            ZRTSModel.Entities.Unit unit2 = new ZRTSModel.Entities.Unit(testGameController.scenario.getZombiePlayer(), 100);
            this.testGameController.addUnit(unit1, 10, 5);
            this.testGameController.addUnit(unit2, 20, 10);
            unit2.setAttackStance(ZRTSModel.Entities.Unit.AttackStance.Agressive);
            unit1.setAttackStance(ZRTSModel.Entities.Unit.AttackStance.Guard);

            testGameController.scenario.getPlayer().player_resources[0] = 300;
            testGameController.scenario.getPlayer().player_resources[1] = 300;
            testGameController.scenario.getPlayer().player_resources[2] = 300;
            testGameController.scenario.getPlayer().player_resources[3] = 300;

            input = new MouseState();
            prevInput = input;

            gameSelectView = new ViewSelect();
            base.Initialize();
        }