Example #1
0
        private bool UpdateActions(PlayerInputAction a, ComboChecker checker)
        {
            if (a.Start.Given && timer >= tap_delay)
            {
                timer     = 0;
                a.started = true;
            }

            if (a.started)
            {
                if (a.Finish.Given)
                {
                    if (timer > time_hold)
                    {
                        checker.AddAction(a.Hold);
                    }
                    else
                    {
                        checker.AddAction(a.Tap);
                    }

                    a.started = false;
                    timer     = 0;
                }
                else if (timer > time_holdMax)
                {
                    checker.AddAction(a.Hold);
                    a.started = false;
                    timer     = 0;
                }

                return(true);
            }
            return(false);
        }
Example #2
0
        public void Update(float seconds, ComboChecker checker)
        {
            timer += seconds;

            bool hold = false;

            hold = UpdateActions(Light, checker) || hold;
            hold = UpdateActions(Heavy, checker) || hold;
            hold = UpdateActions(Special, checker) || hold;

            if (DashLs.Given)
            {
                if (!dashl)
                {
                    dashl = true;
                    dashr = false;
                    timer = 0;
                }
                else
                {
                    checker.AddAction(ComboAction.Dash);
                    dashl = false;
                    timer = 0;
                }
            }

            if (DashRs.Given)
            {
                if (!dashr)
                {
                    dashr = true;
                    dashl = false;
                    timer = 0;
                }
                else
                {
                    checker.AddAction(ComboAction.Dash);
                    dashr = false;
                    timer = 0;
                }
            }

            if (timer >= time_max)
            {
                dashl = false;
                dashr = false;
            }


            if (!hold && timer >= time_pause)
            {
                timer = tap_delay;
                checker.AddAction(ComboAction.Pause);
            }
        }
Example #3
0
        public void Update(float seconds, ComboChecker checker)
        {
            timer += seconds;

            bool hold = false;

            hold = UpdateActions(Light, checker) || hold;
            hold = UpdateActions(Heavy, checker) || hold;
            hold = UpdateActions(Special, checker) || hold;

            if (DashLs.Given)
            {
                if (!dashl)
                {
                    dashl = true;
                    dashr = false;
                    timer = 0;
                }
                else
                {
                    checker.AddAction(ComboAction.Dash);
                    dashl = false;
                    timer = 0;
                }
            }

            if (DashRs.Given)
            {
                if (!dashr)
                {
                    dashr = true;
                    dashl = false;
                    timer = 0;
                }
                else
                {
                    checker.AddAction(ComboAction.Dash);
                    dashr = false;
                    timer = 0;
                }
            }

            if (timer >= time_max)
            {
                dashl = false;
                dashr = false;
            }

            if (!hold && timer >= time_pause)
            {
                timer = tap_delay;
                checker.AddAction(ComboAction.Pause);
            }
        }
Example #4
0
 public override void Initialize(Game game)
 {
     checker = new ComboChecker(tree);
 }
Example #5
0
        private bool UpdateActions(PlayerInputAction a, ComboChecker checker)
        {
            if (a.Start.Given && timer >= tap_delay)
            {
                timer = 0;
                a.started = true;
            }

            if (a.started)
            {
                if (a.Finish.Given)
                {
                    if (timer > time_hold) checker.AddAction(a.Hold);
                    else checker.AddAction(a.Tap);

                    a.started = false;
                    timer = 0;
                }
                else if (timer > time_holdMax)
                {
                    checker.AddAction(a.Hold);
                    a.started = false;
                    timer = 0;
                }

                return true;
            }
            return false;
        }