void checkifdead()
 {
     if (transform.position.y <= cameraTrans.position.y - 6f && !isdead)
     {
         isdead = true;
         gamemanagerscript.gameover();
     }
 }
Beispiel #2
0
 public void updatelives(int currentlives)
 {
     img.sprite = lives[currentlives];
     if (currentlives == 0)
     {
         gameover.gameObject.SetActive(true);
         returnkey.gameObject.SetActive(true);
         exitbutton.gameObject.SetActive(true);
         gm.gameover();
     }
 }
Beispiel #3
0
    void OnTriggerEnter2D(Collider2D col)
    {
        if (col.tag == "rotator")
        {
            transform.SetParent(col.transform);
            gamemanager.scoreupdate();
            col.GetComponent <rotatorscript> ().speed += 10f;

            ispinned = true;
        }
        else if (col.tag == "pin")
        {
            gamemanager.gameover();
        }
    }
Beispiel #4
0
    void OnTriggerEnter(Collider col)
    {
        if (col.tag != "border")
        {
            Destroy(col.gameObject);
            Destroy(gameObject);
            Instantiate(explosion, transform.position, transform.rotation);
            control.addScore(10);
        }

        if (col.tag == "Player")
        {
            Instantiate(playerexplosion, col.transform.position, col.transform.rotation);
            control.gameover();
        }
    }