Score in different rooms

X

Ximenes

Guest
I have with a problem on points, (the game is for two players) I have defined two global variables to point corresponding to each player being 0 and whenever it marks a point goes to a question room where a question occurs, after it returns to first room, but that in that the point variables return to 0. How can I solve this problem?
(I'm new to GameMaker)
 

Rob

Member
I presume you declare your globals in the first room. If so then your global score variables are being reset to 0 every time you go there.

I'm not sure if setting the first room to persistent will fix it but if you have an initialisation room as your first room (a room that's only run once when the game starts) you can declare your global variables there instead.
 
X

Ximenes

Guest
I presume you declare your globals in the first room. If so then your global score variables are being reset to 0 every time you go there.

I'm not sure if setting the first room to persistent will fix it but if you have an initialisation room as your first room (a room that's only run once when the game starts) you can declare your global variables there instead.
I've tried putting it in another room, but whenever I set the variables on an object differently than it reads to write on the screen or send it to the question room or it locks the game or not go into the question room.
 
Top