Hi this is the start function attached to my snake:
void Start()
{
InvokeRepeating("Move", 0.3f, repeatRate);
score = 0;
SetScoreText();
textYouLose.text = "";
}
i wish to change the repeat rate every 5 points (or every time the snake eats 5 pieces of food)
I've tought something like
if(score % 5 == 0)
{ repeatRate /= 2;
}
but it doen't work! Any idea? thanks
↧