Exemplo n.º 1
0
 private Vector3 handleInit; // initial position of the handle
 // Start is called before the first frame update
 void Start()
 {
     handleInit = handle.localPosition;
     handleMaxX = handleInit.x;
     handleMinX = bottom.localPosition.x;
     ballScript = pinball.GetComponent <PinballScript>();
 }
Exemplo n.º 2
0
    public static void reset()
    {
        print("3 lives gained!");
        // Restart game
        gameOver = false;
        // Play sound effect
        source.PlayOneShot(restart, 1.0f);
        // Reset Lives
        lives = 3;
        // Reset the score
        Score.resetScore();
        // Reset Ball
        GameObject ball = GameObject.FindGameObjectWithTag("Ball");

        PinballScript.resetBall(ball);
    }
Exemplo n.º 3
0
 // called second
 void OnSceneLoaded(Scene scene, LoadSceneMode mode)
 {
     UIElements.SetActive(scene.buildIndex != 0);
     player = FindObjectOfType <PinballScript>();
     Score  = 0;
     if (livesImages != null)
     {
         for (int i = 0; i < StartingLives; i++)
         {
             Destroy(livesImages[i]);
         }
     }
     livesImages = new GameObject[StartingLives];
     for (int i = 0; i < StartingLives; i++)
     {
         livesImages[i] = Instantiate(livesImagePrefab, livesContainer.transform);
     }
     lives = StartingLives;
     bombInput.Reset();
 }
Exemplo n.º 4
0
 // Start is called before the first frame update
 void Start()
 {
     bScript = ball.GetComponent <PinballScript>();
 }
 // Start is called before the first frame update
 void Start()
 {
     ball       = GameObject.Find("Pinball");
     ballScript = ball.GetComponent <PinballScript>();
 }
Exemplo n.º 6
0
 // Start is called before the first frame update
 void Start()
 {
     GetComponent <Renderer>().enabled = false;
     ball       = GameObject.Find("Pinball");
     ballScript = ball.GetComponent <PinballScript>();
 }
Exemplo n.º 7
0
 // Start is called before the first frame update
 void Start()
 {
     GetComponent <Renderer>().enabled = false;
     ballScript = ball.GetComponent <PinballScript>();
 }