Ejemplo n.º 1
0
        public void ResetAfterBonus()
        {
            Camera camera = (Services.GetService(typeof(Camera)) as Camera);
            currentLevel = savedLevel;
            player.Location = new Vector2(savedPlayerLocation.X, savedPlayerLocation.Y);
            player.State = savedPlayerState;

            camera.CurrentLevel = currentLevel;
            player.ParentLevel = currentLevel;
        }
Ejemplo n.º 2
0
        public void NextBonusLevel()
        {
            Camera camera = (Services.GetService(typeof(Camera)) as Camera);
            savedLevel = currentLevel;
            savedPlayerLocation = new Vector2(player.Location.X, player.Location.Y);
            savedPlayerState = player.State;

            player.Reset();
            currentBonusLevel = rand.Next(levelList.Where(l => l.IsBonus).Count());
            currentLevel = new GameLevel(levelList[levelList.Where(l => !l.IsBonus).Count() +  currentBonusLevel]);
            player.Location = currentLevel.SpawnLocation;
            camera.CameraTarget = player;
            camera.CurrentLevel = currentLevel;
            player.ParentLevel = currentLevel;
            LoadContent();
            (Services.GetService(typeof(AnimationManager)) as AnimationManager).Add(new LevelTransitions(currentLevel.Title, spriteFont, this));
        }
Ejemplo n.º 3
0
 public void NextLevel()
 {
     Camera camera = (Services.GetService(typeof(Camera)) as Camera);
     currentLevelIndex++;
     player.Reset();
     currentLevel = new GameLevel(levelList[currentLevelIndex]);
     player.Location = currentLevel.SpawnLocation;
     camera.CameraTarget = player;
     camera.CurrentLevel = currentLevel;
     player.ParentLevel = currentLevel;
     LoadContent();
     (Services.GetService(typeof(AnimationManager)) as AnimationManager).Add(new LevelTransitions(currentLevel.Title, spriteFont, this));
 }
Ejemplo n.º 4
0
 public virtual void TakeHit(Sonic player, GameLevel level, out bool blocking)
 {
     blocking = true; return;
 }