Пример #1
0
 public void Reset()
 {
     lightening = 0;
     dudeHit = -1;
     timeCounter = 0;
     score = 0;
     directionX = -10;
     directionTitle = -20;
     directionEnd = 20;
     directionY = 10;
     wind.Stop();
     rain.Stop();
     player = new Cloud(clouds);
     crowd = new Crowd(50, dudes, player);
     title = true;
     gameOver = false;
     speechIndex[0] = -1;
     speechIndex[1] = 0;
     speechCounter = 0;
     speechDrawn = false;
     rain.Play();
     sky = Color.White;
 }
Пример #2
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            oldState = Keyboard.GetState();

            //cloud textures
            clouds = new List<Texture2D>();
            clouds.Add(Content.Load<Texture2D>("SunCloud"));
            clouds.Add(Content.Load<Texture2D>("RainCloud"));
            clouds.Add(Content.Load<Texture2D>("StormCloud"));
            player = new Cloud(clouds);

            //engines
            List<Texture2D> textures = new List<Texture2D>();
            textures.Add(Content.Load<Texture2D>("circle"));
            particleEngine = new ParticleEngine(textures, new Vector2(400, 150));
            titleEngine = new ParticleEngine(textures, new Vector2(400, -10));
            textures = new List<Texture2D>();
            textures.Add(Content.Load<Texture2D>("leaf"));
            leafEngine = new LeafEngine(textures, new Vector2(860, 200));
            endEngine = new LeafEngine(textures, new Vector2(860, 200));

            //text and other var
            font = Content.Load<SpriteFont>("Font1");
            font2 = Content.Load<SpriteFont>("Font2");
            BG = Content.Load<Texture2D>("BG");
            lightening = 0;
            light = Content.Load<Texture2D>("Light1");
            dudeHit = -1;
            bar0 = Content.Load<Texture2D>("Bar/Bar00");
            timeCounter = 0;
            score = 0;
            directionX = -10;
            directionY = 10;
            directionTitle = -20;
            directionEnd = 20;
            title = true;
            TitleScreen = Content.Load<Texture2D>("TitleScreen2");
            titleBG = Content.Load<Texture2D>("TitleBG");
            splashScreen = Content.Load<Texture2D>("Splash");
            gameOver = false;
            End = Content.Load<Texture2D>("GameOver1");
            EndBG = Content.Load<Texture2D>("GameOverBG");
            sky = Color.White;
            splash = 1;

            //happy bar
            bars = new List<Texture2D>();
            bars.Add(Content.Load<Texture2D>("Bar/Bar10"));
            bars.Add(Content.Load<Texture2D>("Bar/Bar20"));
            bars.Add(Content.Load<Texture2D>("Bar/Bar30"));
            bars.Add(Content.Load<Texture2D>("Bar/Bar40"));
            bars.Add(Content.Load<Texture2D>("Bar/Bar50"));
            bars.Add(Content.Load<Texture2D>("Bar/Bar60"));
            bars.Add(Content.Load<Texture2D>("Bar/Bar70"));
            bars.Add(Content.Load<Texture2D>("Bar/Bar80"));
            bars.Add(Content.Load<Texture2D>("Bar/Bar90"));
            bars.Add(Content.Load<Texture2D>("Bar/Bar100"));

            //construct crowd
            dudes = new List<Texture2D>();
            dudes.Add(Content.Load<Texture2D>("Dude/Dude1"));
            dudes.Add(Content.Load<Texture2D>("Dude/Dude2"));
            dudes.Add(Content.Load<Texture2D>("Dude/Dude3"));
            dudes.Add(Content.Load<Texture2D>("Dude/Dude4"));
            dudes.Add(Content.Load<Texture2D>("Dude/Dude5"));
            crowd = new Crowd(50, dudes, player);

            //audio
            thunder = new List<SoundEffect>();
            thunder.Add(Content.Load<SoundEffect>("Sound/Thunder1"));
            thunder.Add(Content.Load<SoundEffect>("Sound/Thunder2"));
            thunder.Add(Content.Load<SoundEffect>("Sound/Thunder3"));
            rain = Content.Load<SoundEffect>("Sound/Rain").CreateInstance();
            rain.IsLooped = true;
            rain.Play();
            wind = Content.Load<SoundEffect>("Sound/Wind").CreateInstance();
            wind.IsLooped = true;
            wind.Volume = 0.7f;
            song = Content.Load<Song>("Parity_Bit");
            songLength = song.Duration;

            //speech
            speechIndex[0] = -1;
            speechIndex[1] = 0;
            speech = new List<Texture2D>();
            speech.Add(Content.Load<Texture2D>("Speech/SpeechHappy"));
            speech.Add(Content.Load<Texture2D>("Speech/SpeechSad"));
            speech.Add(Content.Load<Texture2D>("Speech/SpeechRain"));
            speech.Add(Content.Load<Texture2D>("Speech/SpeechLight"));
            speech.Add(Content.Load<Texture2D>("Speech/SpeechWind"));
            speechDrawn = false;
            speechCounter = 0;
        }