Ejemplo n.º 1
0
            public bool OnPressed(TaikoAction action)
            {
                Drawable target     = null;
                var      drumSample = sampleMappings.SampleAt(Time.Current);

                if (action == CentreAction)
                {
                    target = Centre;
                    drumSample.Centre?.Play();
                }
                else if (action == RimAction)
                {
                    target = Rim;
                    drumSample.Rim?.Play();
                }

                if (target != null)
                {
                    const float alpha_amount = 1;

                    const float down_time = 80;
                    const float up_time   = 50;

                    target.Animate(
                        t => t.FadeTo(Math.Min(target.Alpha + alpha_amount, 1), down_time)
                        ).Then(
                        t => t.FadeOut(up_time)
                        );
                }

                return(false);
            }
Ejemplo n.º 2
0
            public bool OnPressed(KeyBindingPressEvent <TaikoAction> e)
            {
                Drawable target = null;

                if (e.Action == CentreAction)
                {
                    target = Centre;
                    sampleTriggerSource.Play(HitType.Centre);
                }
                else if (e.Action == RimAction)
                {
                    target = Rim;
                    sampleTriggerSource.Play(HitType.Rim);
                }

                if (target != null)
                {
                    const float alpha_amount = 1;

                    const float down_time = 80;
                    const float up_time   = 50;

                    target.Animate(
                        t => t.FadeTo(Math.Min(target.Alpha + alpha_amount, 1), down_time)
                        ).Then(
                        t => t.FadeOut(up_time)
                        );
                }

                return(false);
            }
            public bool OnPressed(TaikoAction action)
            {
                Drawable target = null;
                Drawable back   = null;

                var drumSample = sampleContainer.SampleAt(Time.Current);

                if (action == CentreAction)
                {
                    target = centreHit;
                    back   = centre;

                    if (gameplayClock?.IsSeeking != true)
                    {
                        drumSample.Centre?.Play();
                    }
                }
                else if (action == RimAction)
                {
                    target = rimHit;
                    back   = rim;

                    if (gameplayClock?.IsSeeking != true)
                    {
                        drumSample.Rim?.Play();
                    }
                }

                if (target != null)
                {
                    const float scale_amount = 0.05f;
                    const float alpha_amount = 0.5f;

                    const float down_time = 40;
                    const float up_time   = 1000;

                    back.ScaleTo(target.Scale.X - scale_amount, down_time, Easing.OutQuint)
                    .Then()
                    .ScaleTo(1, up_time, Easing.OutQuint);

                    target.Animate(
                        t => t.ScaleTo(target.Scale.X - scale_amount, down_time, Easing.OutQuint),
                        t => t.FadeTo(Math.Min(target.Alpha + alpha_amount, 1), down_time, Easing.OutQuint)
                        ).Then(
                        t => t.ScaleTo(1, up_time, Easing.OutQuint),
                        t => t.FadeOut(up_time, Easing.OutQuint)
                        );
                }

                return(false);
            }
Ejemplo n.º 4
0
            protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
            {
                if (args.Repeat)
                {
                    return(false);
                }

                Drawable target = null;
                Drawable back   = null;

                if (args.Key == CentreKey)
                {
                    target = centreHit;
                    back   = centre;
                }
                else if (args.Key == RimKey)
                {
                    target = rimHit;
                    back   = rim;
                }

                if (target != null)
                {
                    const float scale_amount = 0.05f;
                    const float alpha_amount = 0.5f;

                    const float down_time = 40;
                    const float up_time   = 1000;

                    back.ScaleTo(target.Scale.X - scale_amount, down_time, Easing.OutQuint)
                    .Then()
                    .ScaleTo(1, up_time, Easing.OutQuint);

                    target.Animate(
                        t => t.ScaleTo(target.Scale.X - scale_amount, down_time, Easing.OutQuint),
                        t => t.FadeTo(Math.Min(target.Alpha + alpha_amount, 1), down_time, Easing.OutQuint)
                        ).Then(
                        t => t.ScaleTo(1, up_time, Easing.OutQuint),
                        t => t.FadeOut(up_time, Easing.OutQuint)
                        );
                }

                return(false);
            }
Ejemplo n.º 5
0
            public bool OnPressed(KeyBindingPressEvent <TaikoAction> e)
            {
                Drawable target = null;
                Drawable back   = null;

                if (e.Action == CentreAction)
                {
                    target = centreHit;
                    back   = centre;

                    sampleTriggerSource.Play(HitType.Centre);
                }
                else if (e.Action == RimAction)
                {
                    target = rimHit;
                    back   = rim;

                    sampleTriggerSource.Play(HitType.Rim);
                }

                if (target != null)
                {
                    const float scale_amount = 0.05f;
                    const float alpha_amount = 0.5f;

                    const float down_time = 40;
                    const float up_time   = 1000;

                    back.ScaleTo(target.Scale.X - scale_amount, down_time, Easing.OutQuint)
                    .Then()
                    .ScaleTo(1, up_time, Easing.OutQuint);

                    target.Animate(
                        t => t.ScaleTo(target.Scale.X - scale_amount, down_time, Easing.OutQuint),
                        t => t.FadeTo(Math.Min(target.Alpha + alpha_amount, 1), down_time, Easing.OutQuint)
                        ).Then(
                        t => t.ScaleTo(1, up_time, Easing.OutQuint),
                        t => t.FadeOut(up_time, Easing.OutQuint)
                        );
                }

                return(false);
            }
Ejemplo n.º 6
0
            public bool OnPressed(TaikoAction action)
            {
                Drawable target = null;
                Drawable back   = null;

                if (action == CentreAction)
                {
                    target = centreHit;
                    back   = centre;
                }
                else if (action == RimAction)
                {
                    target = rimHit;
                    back   = rim;
                }

                if (target != null)
                {
                    const float scale_amount = 0.05f;
                    const float alpha_amount = 0.5f;

                    const float down_time = 40;
                    const float up_time   = 1000;

                    back.ScaleTo(target.Scale.X - scale_amount, down_time, Easing.OutQuint)
                    .Then()
                    .ScaleTo(1, up_time, Easing.OutQuint);

                    target.Animate(
                        t => t.ScaleTo(target.Scale.X - scale_amount, down_time, Easing.OutQuint),
                        t => t.FadeTo(Math.Min(target.Alpha + alpha_amount, 1), down_time, Easing.OutQuint)
                        ).Then(
                        t => t.ScaleTo(1, up_time, Easing.OutQuint),
                        t => t.FadeOut(up_time, Easing.OutQuint)
                        );
                }

                return(false);
            }