• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Windows Go to next room by snake

A

answersearcher

Guest
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

Redemption Seeker
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