Ejemplo n.º 1
0
        // Load graphics content for the game
        public override void Activate()
        {
            if (_content == null)
            {
                _content = new ContentManager(ScreenManager.Game.Services, "Content");
            }

            end = false;

            eggs = new EggSprite[]
            {
                new EggSprite(new Vector2(ScreenManager.GraphicsDevice.Viewport.Width + 60, 240), false),
                new EggSprite(new Vector2(ScreenManager.GraphicsDevice.Viewport.Width + 60, 340), false),
                new EggSprite(new Vector2(ScreenManager.GraphicsDevice.Viewport.Width + 60, 440), false),
                new EggSprite(new Vector2(ScreenManager.GraphicsDevice.Viewport.Width + 60, 540), false),
                new EggSprite(new Vector2(ScreenManager.GraphicsDevice.Viewport.Width + 60, 640), false),
                new EggSprite(new Vector2(ScreenManager.GraphicsDevice.Viewport.Width + 60, 740), false)
            };

            balloons = new BalloonSprite[]
            {
                new BalloonSprite(new Vector2(ScreenManager.GraphicsDevice.Viewport.Width + 64, 250), true),
                new BalloonSprite(new Vector2(ScreenManager.GraphicsDevice.Viewport.Width + 64, 350), true),
                new BalloonSprite(new Vector2(ScreenManager.GraphicsDevice.Viewport.Width + 64, 450), false),
                new BalloonSprite(new Vector2(ScreenManager.GraphicsDevice.Viewport.Width + 64, 550), true),
                new BalloonSprite(new Vector2(ScreenManager.GraphicsDevice.Viewport.Width + 64, 650), true),
                new BalloonSprite(new Vector2(ScreenManager.GraphicsDevice.Viewport.Width + 64, 750), true)
            };

            bird = new BirdSprite();

            c = new BoundingCircle(new Vector2(0, 0) + new Vector2(16, 16), 16);

            _rain      = ScreenManager._rain;
            _fireworks = ScreenManager._fireworks;
            _pop       = ScreenManager._pop;

            _foreground = _content.Load <Texture2D>("Rough_Game_Foreground");
            _midground  = _content.Load <Texture2D>("Rough_Game_Hills");
            _background = _content.Load <Texture2D>("Rough_Game_Sky");

            MediaPlayer.Volume       = ScreenManager.Volume;
            SoundEffect.MasterVolume = ScreenManager.Volume;

            SpriteBatch = ScreenManager.SpriteBatch;

            foreach (var egg in eggs)
            {
                egg.LoadContent(_content);
            }
            foreach (var balloon in balloons)
            {
                balloon.LoadContent(_content);
            }
            bird.LoadContent(_content);
            _font           = _content.Load <SpriteFont>("bangers");
            eggPickup       = _content.Load <SoundEffect>("birdchirping071414");
            popSound        = _content.Load <SoundEffect>("pop");
            backgroundMusic = _content.Load <Song>("007_Synthwave_421k");
            MediaPlayer.Play(backgroundMusic);
            MediaPlayer.IsRepeating = true;

            choice = 3;

            heart = _content.Load <Texture2D>("Rough_Game_Heart");

            //Pause to allow player chance to read instructions
            Thread.Sleep(5000);

            // once the load has finished, we use ResetElapsedTime to tell the game's
            // timing mechanism that we have just finished a very long frame, and that
            // it should not try to catch up.
            ScreenManager.Game.ResetElapsedTime();
        }
Ejemplo n.º 2
0
 public void changeSprite(BirdSprite sprite)
 {
     GetComponent <SpriteRenderer>().sprite = birdData.birdSprite[(int)sprite];
 }