Exemple #1
0
        private void Awake()
        {
            ball = BallControl.Instance;

            powerUpTransform = GetComponent <Transform>();
            yBoundaryOrigin  = player1.yBoundary;

            player1Transform = player1.GetComponent <Transform>();
            player2Transform = player2.GetComponent <Transform>();

            playerOriginScale = player1Transform.localScale;
            // Make random position of power up
            powerUpTransform.position = new Vector2(Random.Range(-xBoundary, xBoundary),
                                                    Random.Range(-yBoundaryOrigin, yBoundaryOrigin));
        }
Exemple #2
0
        public int Score => score; // Getter score

        private void Start()
        {
            ball = BallControl.Instance;
            rb2D = GetComponent <Rigidbody2D>();
        }