SuperGlobals

Blitz3D Forums/Blitz3D Programming/SuperGlobals

You might want to think about making a type for this...
Type SuperGlobal
     Field FrameRate
     Field blah
     Field foo
     ...
     etc.
     ...
End Type


Now you can create a single instance of your SuperGlobal in an Intialise() function and assign startup values.

The benefit is that you wont accidentally re-use variable names because you can't have duplicate variable names inside the type and you will be consistent between modules because trying to use a field that is undefined will also produce an error. [typos should therefore be reduced - e.g. calling it SuperGlobal\EnemyWeaponChoice in one module and SuperGlobal\EnemeyWeaponChosen in another will not lead to weird bugs where one of these variables gets created with a zero value !! ]