예제 #1
0
        public bool Update(float deltaTime)
        {
            if (moveTween != null)
            {
                position = moveTween.Move(deltaTime);
                if (moveTween.finished)
                {
                    moveTween = null;
                }
                return(false);
            }

            foreach (PlayerAction a in settings.actions.Keys)
            {
                if (input.KeyHold(settings.actions[a]))
                {
                    switch (a)
                    {
                    case PlayerAction.moveLeft:
                        return(Move(-1, 0));

                    case PlayerAction.moveRight:
                        return(Move(+1, 0));

                    case PlayerAction.moveDown:
                        return(Move(0, -1));

                    case PlayerAction.moveUp:
                        return(Move(0, +1));

                    case PlayerAction.interact:
                        return(Interact());

                    case PlayerAction.wait:
                        return(true);
                    }
                }
            }
            return(false);
        }