示例#1
0
        public void Initialize(Game _game)
        {
            game = _game;
            scene = new Scene(game);
            pauseScreen = new PauseScreen(game.Content, "Screens/pause", "Fonts/OCR");
            levelCompleteScreen = new LevelCompleteScreen(game.Content, "Screens/levelcomplete", "Fonts/OCR");
            InitParticles();
            startPeeps = gameOptions.StartPeeps;
            levelCount = 0;
            soundPlayer = new SoundPlayer(game.Content);
            soundPlayer.AddSound("Reward", "Audio\\Effects\\reward", false);
            soundPlayer.AddSound("Explosion", "Audio\\Effects\\explosion", false);
            soundPlayer.AddSound("Thrust", "Audio\\Effects\\thrust", true);
            soundPlayer.AddSound("Scream", "Audio\\Effects\\scream", false);
            soundPlayer.AddSound("ScoreUp", "Audio\\Effects\\scoreup", false);
            MediaPlayer.IsRepeating = true;
            MediaPlayer.Volume = gameOptions.MusicVolumeAtPlay;
            MediaPlayer.Play(game.Content.Load<Song>("Audio\\Music\\Pulse"));

            playerOne = new Player(game, "Models/ship", scene.Light);
            playerOne.Fuel=gameOptions.StartFuel;
            playerOne.StartFuel=gameOptions.StartFuel;
            playerOne.Score = 0;
            playerOne.Lives = gameOptions.StartLives;
            CreateLevel();
        }