void OnTriggerEnter2D(Collider2D col) { if (col.name == "tail") { s.line_reset(transform.position); gm.decrease_lifes(); } if (col.tag == "food") { Destroy(col.gameObject); f.add_food(); s.SnakeSize += long_factor; gm.increase_score(10); } }
void OnTriggerEnter2D(Collider2D col) { if (col.name == "tail") { s.line_reset(transform.position); gm.decrease_lifes(); } if (col.tag == "food") { Destroy(col.gameObject); f.add_food(); s.SnakeSize += long_factor; gm.increase_score(10); } }