Ejemplo n.º 1
0
        private void load()
        {
            new BarLineGenerator <BarLine>(Beatmap).BarLines.ForEach(bar => Playfield.Add(bar));

            FrameStableComponents.Add(scroller = new SkinnableDrawable(new TaikoSkinComponent(TaikoSkinComponents.Scroller), _ => Empty())
            {
                RelativeSizeAxes = Axes.X,
                Depth            = float.MaxValue
            });
        }
Ejemplo n.º 2
0
        private void loadBarLines()
        {
            TaikoHitObject lastObject  = Beatmap.HitObjects[Beatmap.HitObjects.Count - 1];
            double         lastHitTime = 1 + (lastObject as IHasEndTime)?.EndTime ?? lastObject.StartTime;

            var timingPoints = Beatmap.ControlPointInfo.TimingPoints.ToList();

            if (timingPoints.Count == 0)
            {
                return;
            }

            int    currentIndex = 0;
            int    currentBeat  = 0;
            double time         = timingPoints[currentIndex].Time;

            while (time <= lastHitTime)
            {
                int nextIndex = currentIndex + 1;
                if (nextIndex < timingPoints.Count && time > timingPoints[nextIndex].Time)
                {
                    currentIndex = nextIndex;
                    time         = timingPoints[currentIndex].Time;
                    currentBeat  = 0;
                }

                var currentPoint = timingPoints[currentIndex];

                var barLine = new BarLine
                {
                    StartTime = time,
                };

                barLine.ApplyDefaults(Beatmap.ControlPointInfo, Beatmap.BeatmapInfo.BaseDifficulty);

                bool isMajor = currentBeat % (int)currentPoint.TimeSignature == 0;
                Playfield.Add(isMajor ? new DrawableBarLineMajor(barLine) : new DrawableBarLine(barLine));

                double bl = currentPoint.BeatLength;
                if (bl < 800)
                {
                    bl *= (int)currentPoint.TimeSignature;
                }

                time += bl;
                currentBeat++;
            }
        }
Ejemplo n.º 3
0
        private void shoot()
        {
            Wave a;

            Playfield.Add(a = new Wave(Team)
            {
                Origin             = Anchor.Centre,
                Depth              = 5,
                PatternColor       = Color4.Red,
                PatternAngleDegree = 0,
                PatternSpeed       = 1f,
                PatternBulletWidth = 8,
                PatternDifficulty  = 1,
            });
            a.MoveTo(ToSpaceOfOtherDrawable(new Vector2(0, 0), a));
        }
Ejemplo n.º 4
0
        public TestSceneNoteSelectionBlueprint()
            : base(4)
        {
            for (int i = 0; i < 4; i++)
            {
                var note = new Note
                {
                    Column    = i,
                    StartTime = i * 200,
                };
                note.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());

                var drawableHitObject = new DrawableNote(note);
                Playfield.Add(drawableHitObject);
                AddBlueprint(new NoteSelectionBlueprint(note), drawableHitObject);
            }
        }
Ejemplo n.º 5
0
 private void load()
 {
     new BarLineGenerator(Beatmap).BarLines.ForEach(bar => Playfield.Add(bar.Major ? new DrawableBarLineMajor(bar) : new DrawableBarLine(bar)));
 }
Ejemplo n.º 6
0
        /// <summary>
        /// All the shooting stuff
        /// </summary>

        private void enemyShoot()
        {
            playerRelativePositionAngle();
            PlaySamples();

            switch (patternID)
            {
            case 2:     // Wave
                Wave w;
                Playfield.Add(w = new Wave(Team)
                {
                    Origin             = Anchor.Centre,
                    Depth              = 6,
                    PatternColor       = Color4.Green,
                    PatternAngleRadian = playerPos,
                    PatternSpeed       = 0.2f,
                    PatternBulletWidth = 8,
                    PatternDifficulty  = 2f,
                    PatternDamage      = 10,
                });
                w.MoveTo(ToSpaceOfOtherDrawable(new Vector2(0, 0), w));
                break;

            case 4:     // Line
                Line l;
                Playfield.Add(l = new Line(Team)
                {
                    Origin             = Anchor.Centre,
                    Depth              = 6,
                    PatternColor       = Color4.Green,
                    PatternAngleRadian = playerPos,
                    PatternSpeed       = 0.2f,
                    PatternBulletWidth = 8,
                    PatternDifficulty  = 2f,
                    PatternDamage      = 10,
                });
                l.MoveTo(ToSpaceOfOtherDrawable(new Vector2(0, 0), l));
                break;

            case 0:     // Cool wave
                CoolWave cw;
                Playfield.Add(cw = new CoolWave(Team)
                {
                    Origin             = Anchor.Centre,
                    Depth              = 6,
                    PatternColor       = Color4.Green,
                    PatternAngleRadian = playerPos,
                    PatternSpeed       = 0.2f,
                    PatternBulletWidth = 8,
                    PatternDifficulty  = 4f,
                    PatternDamage      = 10,
                });
                cw.MoveTo(ToSpaceOfOtherDrawable(new Vector2(0, 0), cw));
                break;

            case 3:     // Circle
                Circle c;
                Playfield.Add(c = new Circle(Team)
                {
                    Origin             = Anchor.Centre,
                    Depth              = 6,
                    PatternColor       = Color4.Cyan,
                    PatternAngleRadian = playerPos,
                    PatternSpeed       = 0.15f,
                    PatternBulletWidth = 12,
                    PatternDifficulty  = 2f,
                    PatternDamage      = 5,
                });
                c.MoveTo(ToSpaceOfOtherDrawable(new Vector2(0, 0), c));
                break;

            case 1:     // Snipe!
                Wave f;
                Playfield.Add(f = new Wave(Team)
                {
                    Origin             = Anchor.Centre,
                    Depth              = 6,
                    PatternColor       = Color4.Green,
                    PatternAngleRadian = playerPos,
                    PatternSpeed       = 0.5f,
                    PatternBulletWidth = 8,
                    PatternDifficulty  = 0.4f,
                    PatternDamage      = 20,
                });
                f.MoveTo(ToSpaceOfOtherDrawable(new Vector2(0, 0), f));
                break;
            }
        }