Global variables not working

Vallyrie

Member
Hello,

I am trying to make a game where the player falls from the top of the screen, collecting letters along the way. I have a text set up in the corner where I'm trying to have a fraction display the amount of letters collected/left. I'm using the following code inside a spawner object's draw event:

global.letters = 0;
draw_text(735, (obj_player1.y - 370), "Letters = " + string(global.letters) + "/9" );


I have the following code inside the collision event of one of the letters (I'm using one letter to test):

global.letters ++;
instance_destroy(other);

The text is displaying, however the 0 is not increasing when I collect the test letter. Does anyone see what I'm doing wrong?

Thanks in advance everyone.
 
Top