Beispiel #1
0
 public CatcherTrailEntry(double startTime, CatcherAnimationState catcherState, float position, Vector2 scale, CatcherTrailAnimation animation)
 {
     LifetimeStart = startTime;
     CatcherState  = catcherState;
     Position      = position;
     Scale         = scale;
     Animation     = animation;
 }
Beispiel #2
0
        public CatcherSprite(CatcherAnimationState state)
            : base(new CatchSkinComponent(componentFromState(state)), _ =>
                   new DefaultCatcherSprite(state), confineMode: ConfineMode.ScaleDownToFit)
        {
            RelativeSizeAxes = Axes.None;
            Size             = new Vector2(CatcherArea.CATCHER_SIZE);

            // Sets the origin roughly to the centre of the catcher's plate to allow for correct scaling.
            OriginPosition = new Vector2(0.5f, 0.06f) * CatcherArea.CATCHER_SIZE;
        }
Beispiel #3
0
        private static CatchSkinComponents componentFromState(CatcherAnimationState state)
        {
            switch (state)
            {
            case CatcherAnimationState.Fail:
                return(CatchSkinComponents.CatcherFail);

            case CatcherAnimationState.Kiai:
                return(CatchSkinComponents.CatcherKiai);

            default:
                return(CatchSkinComponents.CatcherIdle);
            }
        }
Beispiel #4
0
 private void checkState(CatcherAnimationState state) => AddAssert($"catcher state is {state}", () => catcher.CurrentState == state);
Beispiel #5
0
 public DefaultCatcherSprite(CatcherAnimationState state)
 {
     this.state = state;
 }