Exemple #1
0
        protected override void LoadContent()
        {
            // Create the font
            Texture2D playerTexture = Content.Load <Texture2D>("sprites\\ship_main");

            BGSoundControl();
            LoadTextures();
            LoadSoundEffects();
            LoadFonts();

            RedAlertInstance          = RedAlert.CreateInstance();
            RedAlertInstance.IsLooped = true;
            // Set text positions
            textMiddle = new Vector2(GraphicsDevice.Viewport.Width / 1.3f,
                                     graphics.GraphicsDevice.Viewport.Height / 30);
            textLeft = new Vector2(GraphicsDevice.Viewport.Width / 30,
                                   GraphicsDevice.Viewport.Height / 30);

            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            mb         = new MovingBackground(graphics);
            PlayerShip = new Player(GraphicsDevice, new Vector2(400, 300), playerTexture);
            PlayerShip.SetContent(FireballTexture, BeamTexture, ArrowTexture);
            // TODO: use this.Content to load your game content here
        }