Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

[GM7]Ring Counter...


ZFG

Recommended Posts

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

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...