Example #1
0
    public void ReceiveInput(InputReader inputReader)
    {
        float   axisH  = inputReader.GetAxisHorizontalRaw();
        float   axisV  = inputReader.GetAxisVerticalRaw();
        Vector2 change = new Vector2(axisH, axisV)
                         * data.movementSpeed * tsGameplay.DeltaTime();

        mover.OffsetPosition(change);

        if (!tsGameplay.IsPaused())
        {
            if (inputReader.GetKeyDown(KeyCode.Space))
            {
                playerPunch.Punch();
            }
        }

        if (inputReader.GetKeyDown(KeyCode.Escape))
        {
            TogglePause();
        }
    }