Exemplo n.º 1
0
    void Start()
    {
        animator = GetComponent <Animator>();

        loseCollider = GameObject.FindObjectOfType <LoseCollider>();

        levelManager = GameObject.FindObjectOfType <LevelManager>();

        isGameWon = false;
    }
Exemplo n.º 2
0
 // Start is called before the first frame update
 void Start()
 {
     loseCollider = FindObjectOfType <LoseCollider>();
     if (GameObject.FindGameObjectsWithTag("Ball").Length <= 1)
     {
         paddleToBalVector = transform.position - paddle1.transform.position;
     }
     myAudioSource = GetComponent <AudioSource>();
     myRigidbody2D = GetComponent <Rigidbody2D>();
 }
 // Use this for initialization
 void Start()
 {
     loseCollider = GameObject.FindObjectOfType <LoseCollider>();
     isBreakable  = (this.tag == "Breakable");
     if (isBreakable)
     {
         breakableCount++;
     }
     timesHit = 0;
     gm       = GameObject.FindObjectOfType <GM>();
 }
Exemplo n.º 4
0
 void Start()
 {
     spawner      = FindObjectOfType <Spawner>();
     slider       = GetComponent <Slider>();
     audioSource  = GetComponent <AudioSource>();
     levelManager = FindObjectOfType <LevelManager>();
     loseCollider = FindObjectOfType <LoseCollider>();
     winLabel     = GameObject.Find("Win Label");
     winLabel.transform.localScale = new Vector3(0, 0);
     winLabel.SetActive(false);
     SetWinTimer();
 }
Exemplo n.º 5
0
 void Start()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
     shootRenderer = GameObject.FindGameObjectWithTag("ShootSpot");
     srr           = shootRenderer.GetComponent <ShootSpotRenderer>();
 }
Exemplo n.º 6
0
    // Start is called before the first frame update
    void Start()
    {
        // find references
        gameKeeper   = FindObjectOfType <GameKeeper>();
        loseCollider = FindObjectOfType <LoseCollider>();
        ball         = FindObjectOfType <Ball>();
        paddle       = FindObjectOfType <PaddleController>();

        // initialize power up
        object[] powerUps       = Resources.LoadAll("Power-Ups", typeof(Sprite));
        int      maxSpriteIndex = (gameKeeper.level < 5) ? 3 : (gameKeeper.level < 10) ? 8 : powerUps.Length;

        gameObject.GetComponent <SpriteRenderer>().sprite = (Sprite)powerUps[Random.Range(0, maxSpriteIndex)];
        gameObject.GetComponent <Rigidbody2D>().velocity  = new Vector2(0, -2f);
    }
Exemplo n.º 7
0
 void Start()
 {
     lose       = FindObjectOfType <LoseCollider>();
     gameStatus = FindObjectOfType <GameStatus>();
 }
Exemplo n.º 8
0
 // Use this for initialization
 void Start()
 {
     loseCollider = GameObject.FindObjectOfType <LoseCollider>();
     loseCollider.Reset();
 }
Exemplo n.º 9
0
 // Start is called before the first frame update
 void Start()
 {
     nextPos      = startPos.position;
     loseCollider = FindObjectOfType <LoseCollider>();
 }