示例#1
0
        public override void LoadContent()
        {
            ContentManager content = this.ScreenManager.Game.Content;

            this.player = new Player();

            this.graphicsDevice = this.ScreenManager.GraphicsDevice;
            this.spriteBatch = this.ScreenManager.SpriteBatch;

            viewport = graphicsDevice.Viewport;

            bg1 = content.Load<Texture2D>("bg1");
            bg2 = content.Load<Texture2D>("bg2");
            asteroid = content.Load<Texture2D>("asteroid");
            playerTexture = content.Load<Texture2D>("player");
            bulletTexture = content.Load<Texture2D>("bullet");
            ufoTexture = content.Load<Texture2D>("UFO");

            font = content.Load<SpriteFont>("Orbitron");
            font_S = content.Load<SpriteFont>("Orbitron_S");

            player.Initialize(playerTexture);

            cam = new GameCamera(player.Position, viewport, worldWidth, worldHeight);
            cam.Pos = this.player.Position;
        }