Esempio n. 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();
        }
Esempio n. 2
0
 public Level(Game game, ParticleLibrary _particleEffects, ref SoundPlayer _soundPlayer, Scene _scene, Player _playerOne, int peeps, int _levelNumber)
 {
     levelNumber = _levelNumber;
     particleEffects = _particleEffects;
     peepsLeft = peeps;
     scene = _scene;
     scene.Camera.ResetCamera();
     soundPlayer = _soundPlayer;
     map = new Map(game, new Vector3(8, 7, 4), scene.Light, peepsLeft);
     playerOne = _playerOne;
     playerOne.SetStartPosition(map.GetPlayerStartPosition());
     playerOne.SetPlayArea(map.GetPlayArea());
     playerOne.AttachParticleLibrary(particleEffects);
     playerOne.AttachSoundPlayer(ref _soundPlayer);
     playerOne.Reset();
     playerCollisionCheck = CollisionType.None;
     skybox = new Base3DObject(game, "Models/skybox", scene.Light);
     gameHud = new Hud(game.Content, game.GraphicsDevice.Viewport.TitleSafeArea);
 }