Example #1
0
 void OnCollisionEnter2D(Collision2D col)
 {
     if (col.gameObject.tag == "Ball")
     {
         mh.IncrementScore();
         Destroy(gameObject, 0.1f);
         lfs.Cur_Bricks--;
         lfs.UpdateGUI();
     }
 }
Example #2
0
 /*void FixedUpdate()
  * {
  *      rb2d.velocity = rb2d.velocity.normalized;
  *      rb2d.velocity.Scale(new Vector2(speed,speed));
  * }*/
 public void Life()
 {
     if (transform.position.y < ballChecker.transform.position.y && !isDead)
     {
         lfs.Lives--;
         isDead = true;
         lm.RespawnPlayer();
         lfs.UpdateGUI();
         Debug.Log("Life's taken");
     }
 }