Example #1
0
    private void SetMovementDirection(bool isLeft)
    {
        SoundManagerScript.PlayPaddleHit();

        hitCounter++;
        movement.x  = -movement.x;
        movement.y  = (tr.position.y - ball.GetPlayerPosition(isLeft)) / 2f;
        rb.velocity = movement * speed;

        if (GameMode.AIEnable)
        {
            GameMode.AITurn = isLeft;
        }
    }