Пример #1
0
        /// <summary>
        /// Initializes
        /// </summary>
        public void Initialize()
        {
            // TODO: Add your initialization logic here
            Rain = new RainParticleSystem(new Rectangle(0, -20, Screen.SIZE, 10));


            //Rain.IsRaining = false;
            projectedLocation         = new BoundingRectangle();
            projectedLocation.Width   = 29 * Rho.SIZESCALE;
            projectedLocation.Height  = 33 * Rho.SIZESCALE;
            projectedLocationX        = new BoundingRectangle();
            projectedLocationX.Width  = 29 * Rho.SIZESCALE;
            projectedLocationX.Height = 33 * Rho.SIZESCALE;
            projectedLocationY        = new BoundingRectangle();
            projectedLocationY.Width  = 29 * Rho.SIZESCALE;
            projectedLocationY.Height = 33 * Rho.SIZESCALE;
            move    = Vector2.Zero;
            gameMap = new GameMap();
            Player  = new Rho()
            {
                Position = gameMap.RhoStartingPosition
            };

            Land         = new LandingParticleSystem(Player, Color.White);
            inputManager = new InputManager();
            CurrentTime  = 0;

            ChangeBackground();
        }
Пример #2
0
 public WeatherCanvas()
 {
     InitializeComponent();
     timeToCreate = Tools.RandomBetween(0, 2);
     sun          = new SolarSystem();
     star         = new StarParticleSystem();
     smoke        = new SmokeParticleSystem();
     rain         = new RainParticleSystem();
     backBlur     = new BackBlur();
     thunderGen   = new ThunderGenerator();
 }
Пример #3
0
        /// <summary>
        /// Initializes the ScreenManager
        /// </summary>
        public override void Initialize()
        {
            // TODO: Add your initialization logic here
            _rain = new RainParticleSystem(this.Game, new Rectangle(0, -50, 650, 827));
            this.Game.Components.Add(_rain);

            _fireworks = new FireworkParticleSystem(this.Game, 20);
            this.Game.Components.Add(_fireworks);

            _pop = new PopParticleSystem(this.Game, 15);
            this.Game.Components.Add(_pop);

            base.Initialize();
            _isInitialized = true;
        }
Пример #4
0
        /// <summary>
        /// Constructor that Takes in an int.
        /// </summary>
        /// <param name="previousHp">The Hp from the previous level</param>
        public Level2(int previousHp, Game game)
        {
            System.Random rand = new Random();

            health             = new HealthSprite(previousHp);
            hp                 = previousHp;
            player             = new PlayerSprite();
            player.WorldLength = 2073;

            enemiesH = new EnemySprite[]
            {
                new EnemySprite(new Vector2((float)rand.Next(300, 1800), (float)rand.Next(50, 450)), true),
                new EnemySprite(new Vector2((float)rand.Next(300, 1800), (float)rand.Next(50, 450)), true),
                new EnemySprite(new Vector2((float)rand.Next(300, 1800), (float)rand.Next(50, 450)), false),
                new EnemySprite(new Vector2((float)rand.Next(300, 1800), (float)rand.Next(50, 450)), false),
                new EnemySprite(new Vector2((float)rand.Next(300, 1800), (float)rand.Next(50, 450)), false)
            };
            enemiesV = new EnemySprite2[]
            {
                new EnemySprite2(new Vector2((float)rand.Next(100, 1950), (float)rand.Next(200, 300)), true),
                new EnemySprite2(new Vector2((float)rand.Next(100, 1950), (float)rand.Next(200, 300)), true),
                new EnemySprite2(new Vector2((float)rand.Next(100, 1950), (float)rand.Next(200, 300)), false),
                new EnemySprite2(new Vector2((float)rand.Next(100, 1950), (float)rand.Next(200, 300)), false),
                new EnemySprite2(new Vector2((float)rand.Next(100, 1950), (float)rand.Next(200, 300)), true)
            };
            enemiesO = new EnemySprite3[]
            {
                new EnemySprite3(new Vector2((float)rand.Next(350, 1900), (float)rand.Next(50, 450))),
                new EnemySprite3(new Vector2((float)rand.Next(350, 1900), (float)rand.Next(50, 450))),
                new EnemySprite3(new Vector2((float)rand.Next(350, 1900), (float)rand.Next(50, 450))),
                new EnemySprite3(new Vector2((float)rand.Next(350, 1900), (float)rand.Next(50, 450)))
            };

            _lightBlood = new LightBloodParticleSystem(game, 30);
            game.Components.Add(_lightBlood);

            //_explosion = new ExplosionParticleSystem(game, 10);
            //game.Components.Add(_explosion);

            _rain = new RainParticleSystem(game, new Rectangle(0, -20, 3000, 10));
            game.Components.Add(_rain);
        }
Пример #5
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();
        }