コード例 #1
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        ///
        protected override void LoadContent()
        {
            // Create a new sprite batch, this will be used to draw messages
            spriteBatch = new SpriteBatch(GraphicsDevice);

            aspectRatio = graphics.GraphicsDevice.Viewport.AspectRatio;

            landtest = new LandSample(Content, spriteBatch);

            messages = new Messages(Content, spriteBatch, device);

            // TODO: Menu system for creating units

            // creating our units.
            AbstractUnitFactory factory = new ConcreteUnitFactory(Content, units, projectiles);

            factory.CreateUnit(UnitType.Pigeon, new Vector2(-700, 100));
            factory.CreateUnit(UnitType.Tank, new Vector2(700, 100));

            // assign controller(s) to units
            // TODO: refactor? this is a little magical
            Controller p1 = new Controller(PlayerIndex.One, units[0]);

            controllers.Add(p1);

            // set up the boundry grid (for testing..)
            grid = new DisplayGrid(GraphicsDevice);
        }
コード例 #2
0
ファイル: Core.cs プロジェクト: mythicalprogrammer/Beasty
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        /// 
        protected override void LoadContent()
        {
            // Create a new sprite batch, this will be used to draw messages
            spriteBatch = new SpriteBatch(GraphicsDevice);

            aspectRatio = graphics.GraphicsDevice.Viewport.AspectRatio;

            landtest = new LandSample(Content, spriteBatch);

            messages = new Messages(Content, spriteBatch, device);

            // TODO: Menu system for creating units

            // creating our units.
            AbstractUnitFactory factory = new ConcreteUnitFactory(Content, units, projectiles);
            factory.CreateUnit(UnitType.Pigeon, new Vector2(-700, 100));
            factory.CreateUnit(UnitType.Tank, new Vector2(700, 100));

            // assign controller(s) to units
            // TODO: refactor? this is a little magical
            Controller p1 = new Controller(PlayerIndex.One, units[0]);
            controllers.Add(p1);

            // set up the boundry grid (for testing..)
            grid = new DisplayGrid(GraphicsDevice);
        }