ZFG Posted February 23, 2009 Report Share Posted February 23, 2009 ok, so I'm trying to create a new engine for Sonic Core since it's not recommened. //Ring Collision temp = instance_place(x,y,objRing); if(temp&&counter[3]==-1){ with(temp)instance_destroy(); global.Rings+=1; sound_play(sndRing); } This is my Ring collection code, but I get an error when I start the game. ERROR in action number 1 of Draw Event for object Show Stats: Error in code at line 5: cRings = global.Rings; at position 22: Unknown variable Rings How can I fix this? Link to comment Share on other sites More sharing options...
Ollie Posted February 23, 2009 Report Share Posted February 23, 2009 Well if I am not mistaken, you need a "Rings" Variable, have you set one above the code you have shown? Or have I miss read. -.-" Link to comment Share on other sites More sharing options...
ZFG Posted February 23, 2009 Author Report Share Posted February 23, 2009 I have the global.Rings value set in the Stats object. But the game wont accept it :/ Link to comment Share on other sites More sharing options...
dark team Posted February 25, 2009 Report Share Posted February 25, 2009 In which event have you set it? Link to comment Share on other sites More sharing options...
Spike Posted February 25, 2009 Report Share Posted February 25, 2009 You can always make a room at the beginning of the game where all of the global variables are set. That's what a lot of people do. In the creation of the title screen room (Or any room before you use the variable, really) just put "global.Rings=0". Link to comment Share on other sites More sharing options...
ZFG Posted February 25, 2009 Author Report Share Posted February 25, 2009 I just figured it out, thanks anyway. Link to comment Share on other sites More sharing options...
Recommended Posts