Пример #1
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);
            SpriteBatchExtensions.MainSpriteBatch = spriteBatch;

            ContentAccessor contentAccessor = new ContentAccessor(Content);

            contentAccessor.LoadContent();

            gameWorld = new GameWorld(1900, 1100);

            gameWorld.AddNewGameObject(player =
                                           new Avatar(
                                               ContentAccessor.CircleColoredTest,
                                               GameConfig.GameObjectStandards.AvatarStandards.GetStandardAvatarBody(200, 200),
                                               new KeyboardMouseController()
                                               ));

            gameWorld.AddNewGameObject(box =
                                           new Obstacle(
                                               gameWorld,
                                               ContentAccessor.ObstacleCrate1,
                                               new Rectangle(50, 50, 100, 100)));

            gameWorld.AddNewGameObject(blueAmmoLoot = new Loot(
                                           new Blue762Ammunition(
                                               60
                                               ), 500, 500
                                           ));

            gameWorld.AddNewGameObject(ot38Loot = new Loot(
                                           new OT38Gun(),
                                           600, 600
                                           ));

            camera = new Camera(player);
            SpriteBatchExtensions.Camera = camera;
        }