Example #1
0
 public void Move(int x, int y, Ball.Direction dir)
 {
     foreach (var t in items)
     {
         if (t.selected)
         {
             t.move(x, y, dir);
         }
     }
 }
Example #2
0
    private void OnScore(int who)
    {
        GameObject nextStart = player;

        Ball.Direction newDir = Ball.Direction.TO_PLAYER;
        if (who == PLAYER)
        {
            playerScore++;
            playerScoreText.text = playerScore.ToString();
        }
        else
        {
            opponentScore++;
            opponentScoreText.text = opponentScore.ToString();

            nextStart = opponent;
            newDir    = Ball.Direction.TO_OPPONENT;
        }

        ball.GetComponent <Ball>().ResetBall(nextStart, newDir);
    }