private void OnCollisionEnter2D(Collision2D collision) { firstBlockbool = FindObjectOfType <hotairballoon>(); if (!(collision.gameObject.tag == "baseBlock")) { //if its not baseblock // firstBlockbool.resize(); // firstBlockbool.collisonsubstracter(); birdsound.Play(); Destroy(collision.gameObject); Instantiate(birds, this.transform.position, this.transform.rotation); Destroy(gameObject); print("birdexplode"); firstBlockbool.updatelives(); } else { firstBlockbool.resize(); //firstBlockbool.collisonsubstracter(); firstBlockbool.birdfirstb(); Destroy(collision.gameObject); Instantiate(birds, this.transform.position, this.transform.rotation); Destroy(gameObject); firstBlockbool.updatelives(); } }
// Use this for initialization void Start() { // this.gameObject.transform.position = spawnpoint; firstBlockbool = FindObjectOfType <hotairballoon>();// //alphaFactor = 1 / totallyDarkHeight; }
// Use this for initialization void Start() { // this.gameObject.transform.position = spawnpoint; firstBlockbool = FindObjectOfType <hotairballoon>();// birdsound = GetComponent <AudioSource>(); alphaFactor = 1 / totallyDarkHeight; birdsound.Play(); }
private void OnCollisionEnter2D(Collision2D collision) { firstBlockbool = FindObjectOfType <hotairballoon>(); // firstBlockbool.collisonadder(); //if (this.transform.localScale.x == collision.transform.localScale.x )//* (3.75f / 4f)) print("ayushcc"); if (collision.gameObject.tag == "buildingBlock") { firstBlockbool.counterblockl1(); if (SceneManager.GetActiveScene().name == "Start") { if (collision.transform.localScale.x >= -0.01004417) { print("ayushccd"); firstBlockbool.checkwin(); } } if (SceneManager.GetActiveScene().name == "level 2") { print("ayushccd"); } { if (collision.transform.localScale.x >= -0.01576463) { firstBlockbool.checkwin(); } } if (SceneManager.GetActiveScene().name == "level3") { print("ayushccd"); } { if (collision.transform.localScale.x >= -0.0137034) { firstBlockbool.checkwin(); } } if (collision.transform.tag == "ground") { firstBlockbool.counterblocks1(); } } }
// Use this for initialization void Start() { this.gameObject.transform.position = spawnpoint; firstBlockbool = FindObjectOfType <hotairballoon>();// birdsound = GetComponent <AudioSource>(); }
private void Start() { firstBlockbool = FindObjectOfType <hotairballoon>(); }
// Use this for initialization void Start() { this.gameObject.transform.position = spawnpoint; firstBlockbool = FindObjectOfType <hotairballoon>();// }
// Use this for initialization void Start() { this.gameObject.transform.position = spawnpoint; firstBlockbool = FindObjectOfType <hotairballoon>();// rb = GetComponent <Rigidbody2D>(); }