I was wondering if it is possible to have such variables, used much like instance variables but for objects that don't have multiple instances (such as the mouse). From what I can find this doesn't exist which means I have to use global variables in a lot of cases. Sometimes global variables are overkill for the task at hand, which is where these sorts of variable really help.
No, i think you might have to just settle for global variables, i mean if they work than i don't think they'd put in a third option. check the manual, it would be in there if there was a third method to variables.
briggybros wrote:If you are working on a big project though, you may need a lot of variables and if they are all global like they are now surely they start to become disorganised and begin to impact workflow.
Yes that is what I am experiencing at this moment sadly.
@Jomo has a good point. I also add global sprites and use them as variable containers. The downside is you must make sure these objects exist on every layout or create them at the start of layouts you will need them on. I have an object called Global and then a bunch of instance variables on it. When I want a variable I simply say Global.whatever. Makes it easy for me.