예제 #1
0
        private void attemptCatch(Fruit fruit)
        {
            fruit.X += catcher.X;
            fruit.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty
            {
                CircleSize = circleSize
            });

            foreach (var area in this.ChildrenOfType <CatcherArea>())
            {
                DrawableFruit drawable = new DrawableFruit(fruit);
                area.Add(drawable);

                Schedule(() =>
                {
                    bool caught = area.AttemptCatch(fruit);
                    area.OnNewResult(drawable, new JudgementResult(fruit, new CatchJudgement())
                    {
                        Type = caught ? HitResult.Great : HitResult.Miss
                    });

                    drawable.Expire();
                });
            }
        }
예제 #2
0
        private void catchFruit(Fruit fruit, float x)
        {
            fruit.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
            var drawableFruit = new DrawableFruit(fruit)
            {
                X = x
            };
            var judgement = fruit.CreateJudgement();

            catcher.OnNewResult(drawableFruit, new CatchJudgementResult(fruit, judgement)
            {
                Type = judgement.MaxResult
            });
        }
예제 #3
0
        private void spawnFruits(bool hit = false)
        {
            for (int i = 1; i <= 4; i++)
            {
                var fruit = new Fruit
                {
                    X           = getXCoords(hit),
                    LastInCombo = i % 4 == 0,
                    StartTime   = playfieldTime + 800 + (200 * i)
                };

                fruit.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());

                addToPlayfield(new DrawableFruit(fruit));
            }
        }
예제 #4
0
        private void attemptCatch(Fruit fruit)
        {
            fruit.X = fruit.OriginalX + catcher.X;
            fruit.ApplyDefaults(new ControlPointInfo(), beatmapDifficulty);

            foreach (var area in this.ChildrenOfType <CatcherArea>())
            {
                DrawableFruit drawable = new DrawableFruit(fruit);
                area.Add(drawable);

                Schedule(() =>
                {
                    area.OnNewResult(drawable, new CatchJudgementResult(fruit, new CatchJudgement())
                    {
                        Type = area.MovableCatcher.CanCatch(fruit) ? HitResult.Great : HitResult.Miss
                    });

                    drawable.Expire();
                });
            }
        }
예제 #5
0
        private void checkHyperDashFruitColour(ISkin skin, Color4 expectedColour)
        {
            DrawableFruit drawableFruit = null;

            AddStep("create hyper-dash fruit", () =>
            {
                var fruit = new Fruit {
                    HyperDashTarget = new Banana()
                };
                fruit.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());

                Child = setupSkinHierarchy(drawableFruit = new DrawableFruit(fruit)
                {
                    Anchor = Anchor.Centre,
                    Origin = Anchor.Centre,
                    Scale  = new Vector2(4f),
                }, skin);
            });

            AddAssert("hyper-dash colour is correct", () => checkLegacyFruitHyperDashColour(drawableFruit, expectedColour));
        }