private void OnTriggerEnter2D(Collider2D other)
{
if (other.CompareTag(“Wall”))
{
for (int i = 1; i <= 16; i++)
{
GameObject Clone = GameObject.Find(“Spikes(Clone)”);
if (Clone)
{
Destroy(Clone);
}
}
if (x > 0)
{
x = -(x + 0.001f);
Instantiate(Spikes, new Vector3(-7.75f, 3, 0), Quaternion.AngleAxis(270f, Vector3.forward));
Instantiate(Spikes, new Vector3(-7.75f, 2, 0), Quaternion.AngleAxis(270f, Vector3.forward));
}
else
{
x = -(x - 0.001f);
Instantiate(Spikes, new Vector3(7.75f, 3, 0), Quaternion.AngleAxis(90f, Vector3.forward));
}
points++;
}