Example #1
0
        internal override HitObject Clone()
        {
            HitCircle h = new HitCircle(Position, StartTime, (Type & HitObjectType.NewCombo) > 0,
                                        (SoundType & HitObjectSoundType.Whistle) > 0,
                                        (SoundType & HitObjectSoundType.Finish) > 0);

            h.SetColour(Colour);
            h.ComboNumber = ComboNumber;
            h.Selected    = Selected;

            return(h);
        }
Example #2
0
        override internal void UpdateCalculations(bool force)
        {
            if (force || taikoMiddle == null)
            {
                sliderStartCircle = new HitCircle((int)Position.X, (int)Position.Y, StartTime, false, SoundType);
                sliderStartCircle.SetColour(Colour);

                for (int i = 0; i < sliderStartCircle.SpriteCollection.Count; i++)
                {
                    SpriteCollection.Add(sliderStartCircle.SpriteCollection[i]);
                    HitObjectManager.spriteManager.Add(sliderStartCircle.SpriteCollection[i]);
                }

                float scalefactor = (SoundType & HitObjectSoundType.Finish) == 0 ? 0.7f : 1;

                sliderLength *= sliderRepeatCount;
                double v = HitObjectManager.SliderScoringPointDistance * BeatmapManager.Current.DifficultySliderTickRate;
                double b = AudioEngine.beatLengthAt(StartTime);
                EndTime = StartTime + (int)(sliderLength / v * b);

                taikoMiddle = new pSprite(SkinManager.Load("taiko-roll-middle"), FieldTypes.Gamefield, OriginTypes.TopLeft, ClockTypes.Audio, new Vector2(Position.X, Position.Y - HitObjectManager.HitObjectRadius * scalefactor), SpriteManager.drawOrderBwd(EndTime + 10),
                                          false, new Color(252, 184, 6));
                taikoMiddle.UseVectorScale = true;
                taikoMiddle.VectorScale    = new Vector2((float)sliderLength * GameBase.WindowRatio / HitObjectManager.SpriteRatio * (1 / scalefactor), 1);
                taikoMiddle.Transformations.Add(new Transformation(TransformationType.Fade, 0, 1, StartTime - HitObjectManager.PreEmpt, StartTime));
                taikoMiddle.Transformations.Add(new Transformation(TransformationType.Fade, 1, 0, EndTime, EndTime + HitObjectManager.PreEmptSliderComplete));
                HitObjectManager.spriteManager.Add(taikoMiddle);
                SpriteCollection.Add(taikoMiddle);

                taikoEnd = new pSprite(SkinManager.Load("taiko-roll-end"), FieldTypes.Gamefield, OriginTypes.TopLeft, ClockTypes.Audio, new Vector2(Position.X, Position.Y - HitObjectManager.HitObjectRadius * scalefactor), SpriteManager.drawOrderBwd(EndTime + 8),
                                       false, new Color(252, 184, 6));
                taikoEnd.OriginPosition = new Vector2((float)-sliderLength * GameBase.WindowRatio / HitObjectManager.SpriteRatio * (1 / scalefactor), 0);
                taikoEnd.Transformations.Add(new Transformation(TransformationType.Fade, 0, 1, StartTime - HitObjectManager.PreEmpt, StartTime));
                taikoEnd.Transformations.Add(new Transformation(TransformationType.Fade, 1, 0, EndTime, EndTime + HitObjectManager.PreEmptSliderComplete));
                HitObjectManager.spriteManager.Add(taikoEnd);
                SpriteCollection.Add(taikoEnd);

                sliderBall.Transformations.Add(new Transformation(sliderStartCircle.Position,
                                                                  sliderStartCircle.Position, StartTime - 500, EndTime));
                sliderFollower.Transformations.Add(new Transformation(sliderStartCircle.Position,
                                                                      sliderStartCircle.Position, StartTime, EndTime));

                counter =
                    new pSpriteText("", SkinManager.Current.FontScore, SkinManager.Current.FontScoreOverlap,
                                    FieldTypes.Gamefield, OriginTypes.Centre, ClockTypes.Audio,
                                    new Vector2(100, 150), 0.9f, false, Color.White);
                counter.CurrentScale = 0.8f;
                counter.Transformations.Add(new Transformation(TransformationType.Fade, 0, 1, StartTime, StartTime));
                counter.Transformations.Add(new Transformation(TransformationType.Fade, 0.6f, 0, EndTime, EndTime + 300));
                HitObjectManager.spriteManager.Add(counter);

                newCache = false;

                if (scalefactor != 1)
                {
                    foreach (pSprite p in SpriteCollection)
                    {
                        p.CurrentScale *= 0.7f;
                    }
                }
            }
        }