Windows Go to next room by snake

I'm making snake for school. But I don't know how you get to the next room. If you have eaten 5 times the apple then the game have to go to the next room. Could
you help?
 

FrostyCat

Member
How many classes have you skipped to miss something this basic?

Create an object called objController and have this in its Create event:
GML:
global.applesEaten = 0;
And this ongoing check in its Step event:
GML:
if (global.applesEaten >= 5) {
    room_goto_next();
}
Then add an instance of objController into the room.

Now do this whenever the player eats an apple:
GML:
global.applesEaten += 1;
 
Top