Exemple #1
0
        public void Update(GameTime gameTime)
        {
            if (!Keyboard.GetState().NumLock&& !numlockWarning)
            {
                numlockWarning = true;
                Map.Track.Pause();
            }
            else if (Keyboard.GetState().NumLock&& numlockWarning)
            {
                numlockWarning = false;
                Map.Track.Play();
            }

            float trackPosition = Map.Track.GetPosition();
            IEnumerable <BeatmapNote> notesToShow = Map.BeatmapNotes.Where(note => trackPosition > (note.time - Map.ArInMs()) && trackPosition < (Map.HitWindow.Max(note.time)));

            foreach (BeatmapNote note in notesToShow)
            {
                int        index    = note.position;
                int        mapIndex = Array.IndexOf(Map.BeatmapNotes, note);
                BeatSquare bs       = beatSquares.Children[index];
                if (bs.Note == null && playResult.Accuracies[mapIndex] == Accuracy.None)
                {
                    bs.SetNoteData(note, mapIndex);
                }
            }

            beatSquares.Update(gameTime);
            accuracyDisplay.Update(gameTime);
        }