Exemple #1
0
        public void LoadContent()
        {
            texture = game.Content.Load<Texture2D>("soil");
            this.camera = ((ScrapGame)game).camera;

            effect = new BasicEffect(game.GraphicsDevice);
            effect.TextureEnabled = true;
            effect.Texture = texture;
            renderTarget = new RenderTarget2D(game.GraphicsDevice, game.GraphicsDevice.Viewport.Width, game.GraphicsDevice.Viewport.Height, false, SurfaceFormat.RgbPvrtc4Bpp, DepthFormat.Depth24Stencil8); //game.GraphicsDevice.DisplayMode.Format, DepthFormat.Depth24);
        }
Exemple #2
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);
            background = Content.Load<Texture2D>("sky");
            foreground = Content.Load<Texture2D>("nearback");
            world = new World(new Vector2(0, 1f));

            debugView = new DebugViewXNA(world);
            camera = new Camera(this);
            camera.Position = new Vector2(22,20);
            debugView.LoadContent(GraphicsDevice, Content);

            playerController.LoadContent();
            badger = new ScrapBadger(this, new Vector2(23, 4));

            badger.Rotate(20f * 0.0174532925f);

            crate = new Crate(this, new Vector2(26, 2));
            //XmlLoader loader = new XmlLoader();
            //loader.LoadLevel(ref entityList);

            terrain.LoadContent();
            terrain.CreateGround(world);

            //Init();
        }