Exemple #1
0
        public new void Update(GameTime gameTime)
        {
            if (running)
            {
                if (game.HUD.Time >= 240)
                {
                    game.AchiTracker.UnlockSpeedRun();
                }

                if (Position.X < game.Map.Width - 6)
                {
                    mario.Position = new Vector2(Position.X + 0.05f, Position.Y);
                    Game1.Camera.PanCamera(2, game);
                    mario.Update(gameTime);
                }
                else
                {
                    mario.RightReleased();
                    hidden = true;
                }
                if (hidden)
                {
                    ++hiddenInterval;
                }
                if (hiddenInterval == 100)
                {
                    game.WorldLoader.Background.Add(new ToadCastleFlag()
                    {
                        Position = new Vector2(castle.Position.X + 2, 7.5f)
                    });
                }
                if (hiddenInterval > 0 && hiddenInterval % 100 == 0)
                {
                    Fireball fire = new Fireball(game, new Vector2(rnd.Next((int)castle.Position.X - 1, (int)castle.Position.X + 6), rnd.Next(1, 6)), 0)
                    {
                        Interval = 100
                    };
                    game.WorldLoader.Fireballs.Add(fire);
                }

                if (hiddenInterval > 200)
                {
                    if (game.LevelName == "Level1-1")
                    {
                        game.AchiTracker.UpdateAchievement();
                        AchievementScreen.ShowAchievements(game, "Level1-4");
                    }
                }
            }
            else
            {
                Position = new Vector2(Position.X, Position.Y + 0.1f);
                if (Position.Y - Bounds.Y >= 12)
                {
                    Run();
                }
            }
        }
 public static void Update(Game1 game)
 {
     if (showLivesRemaining > 0)
     {
         --showLivesRemaining;
         if (showLivesRemaining == 0)
         {
             AchievementScreen.ShowAchievements(game, "NONE");
         }
     }
 }
 public void Use()
 {
     // game.WorldLoader.LoadWorld("Level1-1", game, false);
     game.AchiTracker.UpdateAchievement();
     AchievementScreen.ShowAchievements(game, "Level1-1");
 }