Пример #1
0
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            Art.Load(Content);

            // TODO: use this.Content to load your game content here
            ship        = new Ship(Art.Ship, ScaleToHighDPI(shipSize), ScaleToHighDPI(shipSize));
            ship.Height = 125; ship.Width = 100;

            swarm      = new ShipCollection(Art.Swarm, ScaleToHighDPI(swarmSize), ScaleToHighDPI(swarmSize));
            starsFront = new RollingSprite(Art.StarsFront, ScaleToHighDPI(1.1f), ScaleToHighDPI(1f), screenWidth, screenHeight);
            starsBack  = new RollingSprite(Art.StarsBack, ScaleToHighDPI(1.1f), ScaleToHighDPI(1f), screenWidth, screenHeight);
            lives      = new LivesPanel(Art.Ship, ScaleToHighDPI(.4f), ScaleToHighDPI(.4f));
        }
Пример #2
0
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // TODO: use this.Content to load your game content here
            ship        = new Ship(Content.Load <Texture2D>("ship"), Content.Load <Texture2D>("lazer"), Content.Load <Texture2D>("swarm_explode"), ScaleToHighDPI(shipSize), ScaleToHighDPI(shipSize));
            ship.Height = 125; ship.Width = 100;

            swarm           = new ShipCollection(Content.Load <Texture2D>("swarm"), Content.Load <Texture2D>("lazer"), Content.Load <Texture2D>("swarm_explode"), ScaleToHighDPI(swarmSize), ScaleToHighDPI(swarmSize));
            starsFront      = new RollingSprite(Content.Load <Texture2D>("starsFront"), ScaleToHighDPI(1.1f), ScaleToHighDPI(1f), screenWidth, screenHeight);
            starsBack       = new RollingSprite(Content.Load <Texture2D>("starsBack"), ScaleToHighDPI(1.1f), ScaleToHighDPI(1f), screenWidth, screenHeight);
            lives           = new LivesPanel(Content.Load <Texture2D>("ship"), ScaleToHighDPI(.4f), ScaleToHighDPI(.4f));
            scoreFont       = Content.Load <SpriteFont>("Score");
            stateFont       = Content.Load <SpriteFont>("GameState");
            stateFontMedium = Content.Load <SpriteFont>("GameStateMedium");
            gameOverTexture = Content.Load <Texture2D>("game-over");
        }