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(); }
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); }
public BaseScreen(ContentManager content, String assetName, String fontName) { background = new Sprite(content.Load<Texture2D>(assetName)); background.Position = new Vector2(background.Width/2, background.Height/2); font = content.Load<SpriteFont>(fontName); overlay = new Sprite(content.Load<Texture2D>("Sprites/pixel")); overlay.Width = background.Width; overlay.Height= background.Height; overlay.Position = Vector2.Zero; overlay.Colour = Color.Black; overlayAlpha = 1.0f; fadeSpeed = 1.0f; originalFadeSpeed = fadeSpeed; soundPlayer = new SoundPlayer(content); soundPlayer.AddSound("Select", "Audio\\Effects\\select", false); options = new List<String>(); menuAlignment = 0; menuColour = Color.White; selectedColour = Color.Blue; loaded = 0; Reset(); }
public void AttachSoundPlayer(ref SoundPlayer _soundPlayer) { soundPlayer = _soundPlayer; }