I've been looking through the forums to see if anyone's mentioned this, but as of yet, I haven't found any topics on this.
My problem is this. I'm creating a game that you can dig for rocks and minerals and such. Each "spot" you can dig is a sprite. I have one sprite that I copied and pasted around. I gave that sprite an instance variable, so that each time you clicked on it, it would add to that variable, and once a specific number was reached, that object would be destroyed. It was nice, with the instance variable, because then each was independent of one another and worked great. Until I left that layout, and came back. Then they were all back, even if they had already been destroyed. (I wouldn't mind them coming back eventually, being "replenished", but not instantly) So I figured it had something to do with it being on that layout, and getting reset when i left and came back. So I made them global, so their variables would be saved even if I left and came back. That worked... except (dun dun duuuuuh)... when i left the layout they were placed in, they seemed to disappear. (really they were just going to the very very back, because if i went to a layout that didn't have a tile background, "blank" i could see them. And even though i couldn't see them on the layout i made them on, i could still click on them (once if found their position) and their instance variables stayed stored nicely.
*whew* sorry for the long description. Anyways. I would like to keep them global, but I want them to stay on top of the layout i want them to be seen in, and not seen in the others.
This will help me when i want a type of hud that i can carry though the other layouts, and i will defiantly want them visible. Thanks for your help.
*edit: I am aware that I could make global variables and assign them as different sprites, and have each global variable linked to each though the events page. But that seems way too repetitive. (I'm willing and able to do that, just want to find out if there's a way to get it working this other way) It seems really really close to what i want, not sure if there's something I'm missing thats keeping it for doing exactly what i want. (and I have tried making them in a layer above everything else in the layout I have them on, to see if that kept them above the "ground" and they still move under the tiled background) Thanks again