Example #1
0
        private void UpdateTimeLabel()
        {
            var time = Map.LevelTimeSeconds;

            TimeLabel.Text     = LevelConverter.ConvertToDefaultTime(time);
            TimeLabel.Location = new Point(Screen.Width - TimeLabel.Size.Width + 1, 0);
            TimeLabel.Image    = ImageExtensions.FitInSize(timerBackground, TimeLabel.Size);
        }
Example #2
0
 public Map()
 {
     converted       = LevelConverter.GetAllLevels();
     BestLevelTime   = converted[levelId].Item1;
     AvailableLevels = converted
                       .Select(t => t.Item2)
                       .ToList();
     StartPosition = new Point(1, 1);
     Level         = MapBuilder.CreateMap(AvailableLevels[levelId]);
 }
Example #3
0
 public void UpdateBestTime(bool isNewRecord = true)
 {
     if (LevelTimeSeconds < BestLevelTime || !isNewRecord)
     {
         if (isNewRecord)
         {
             BestLevelTime = LevelTimeSeconds;
         }
         converted[levelId] = Tuple.Create(BestLevelTime, converted[levelId].Item2);
         LevelConverter.WriteChanges(converted);
     }
 }
Example #4
0
        private void UpdateFinishMessage()
        {
            var time = Map.LevelTimeSeconds;

            FinishMessage.Text      = @$ "{(IsLastLevelCompleted ? " ИГРА ПРОЙДЕНА !" : " УРОВЕНЬ ПРОЙДЕН !")}

ВАШЕ ВРЕМЯ: {LevelConverter.ConvertToDefaultTime(time)}
ЛУЧШЕЕ ВРЕМЯ: {LevelConverter.ConvertToDefaultTime(Map.BestLevelTime)}";
            FinishMessage.Size      = Screen.Size;
            FinishMessage.BackColor = Color.FromArgb(230, 64, 64, 64);
            FinishMessage.Font      = new Font("Arial", 100F * Screen.Width / 1920, FontStyle.Bold, GraphicsUnit.Point);
        }