Exemple #1
0
 //when an enemy hits the paddle line, dec the HP as needed
 private void checkPos()
 {
     if (transform.position.x <= -20)
     {
         sm.decHP();
         Destroy(gameObject);
     }
 }
Exemple #2
0
 //decrements health and ensures next ball launch is consistent
 private void Death()
 {
     start       = false;
     rb.velocity = new Vector3(0f, 0f, 0f);
     sm.decHP();
 }