Esempio n. 1
0
        public void Draw(double currentBeat)
        {
            // Draw order
            // 1. Hold bodies
            // 2. Slides
            // 3. Shuffles
            // 4. Notes
            // 5. Start note
            // 6. Hit texture


            for (int i = 0; i < Notes.Count; i++)
            {
                var prevNote = i == 0 ? StartNote : Notes[i - 1];
                // Hold bodies
                if (Notes[i].Type == NoteType.Hold)
                {
                    Notes[i].Draw(currentBeat, prevNote, NoteType.Hold);
                }

                // Slides
                if (Notes[i].Type == NoteType.Slide)
                {
                    Notes[i].Draw(currentBeat, prevNote, NoteType.Slide);
                }

                // Shuffles
                if (Notes[i].Type == NoteType.Shuffle)
                {
                    Notes[i].Draw(currentBeat, prevNote, NoteType.Shuffle);
                }

                // Notes
            }

            // Start note
            StartNote.Draw(currentBeat);

            // Hit texture
        }
Esempio n. 2
0
        //public void Draw(double currentBeat, Matrix view, Matrix projection)
        //{
        //    // Draw everything but the start note
        //    for (int i = 0; i < Notes.Count; i++)
        //    {
        //        var prevNote = i == 0 ? StartNote : Notes[i - 1];
        //        Notes[i].Draw(currentBeat, view, projection, prevNote);
        //    }

        //    // Draw start note
        //    StartNote.Draw(currentBeat, view, projection);

        //    // Draw hit texture if necessary
        //    if (IsPlayerHolding)
        //        HitTexture.Draw(view, projection);
        //}

        public void Draw(double currentBeat, Matrix view, Matrix projection, int overlapIndex = 0)
        {
            // Draw order
            // Hold bodies
            // Slides
            // Then shuffles
            // The Notes

            // Draw hold bodies first
            for (int i = 0; i < Notes.Count; i++)
            {
                var prevNote = i == 0 ? StartNote : Notes[i - 1];
                if (Notes[i].Type == NoteType.Hold || Notes[i].Type == NoteType.Shuffle)
                {
                    Notes[i].Draw(currentBeat, view, projection, prevNote, overlapIndex, NoteType.Hold);
                }
            }
            // Then draw slides
            for (int i = 0; i < Notes.Count; i++)
            {
                var prevNote = i == 0 ? StartNote : Notes[i - 1];
                if (Notes[i].Type == NoteType.Slide)
                {
                    Notes[i].Draw(currentBeat, view, projection, prevNote, overlapIndex);
                }
                ;
            }
            // Then draw shuffles
            for (int i = 0; i < Notes.Count; i++)
            {
                var prevNote = i == 0 ? StartNote : Notes[i - 1];
                if (Notes[i].Type == NoteType.Shuffle)
                {
                    Notes[i].Draw(currentBeat, view, projection, prevNote, overlapIndex, NoteType.Shuffle);
                }
                ;
            }
            // Then draw notes
            for (int i = 0; i < Notes.Count; i++)
            {
                var prevNote = i == 0 ? StartNote : Notes[i - 1];
                if (Notes[i].Type == NoteType.Step)
                {
                    Notes[i].Draw(currentBeat, view, projection, prevNote, overlapIndex);
                }
                ;
            }

            // Draw start note
            StartNote.Draw(currentBeat, view, projection);

            // Draw hit texture if necessary
            if (Notes.Last().BeatLocation < currentBeat)    // Sanity check first
            {
                IsPlayerHolding = false;
            }
            if (IsPlayerHolding)
            {
                HitTexture.Draw(view, projection);
            }
        }