For instance, I am creating a game with 100 levels, and each should have a button to access them. I am locking them so that they will unlock as they progress. like this
If [GlobalVariable] <= 0, Create [padlock] on [ObjectName].CenterX(), [ObjectName].CenterY()
I have level buttons 1 to 100, in which their Object Name is lev{number}
I have singlelevelbuttons group containing lev1 to 9 buttons
I have doublelevelbuttons group containing lev10 to lev 99 buttons
the lev100 button stands alone
The Global variable is a structure containing children title 01 to 09, 10 to 99, 100
So GlobalVariable = Levels.0[ToNumber(singlelevelbuttons.LabelText())] and
So GlobalVariable = Levels.[ToNumber(doublelevelbuttons.LabelText())]
So I want to do this:
Repeat each instance for singlelevelbuttons
If Levels.0[ToNumber(singlelevelbuttons.LabelText())] <= 0, Create [padlock] on lev[ToNumber(StrAt(singlelevelbuttons.ObjectName(), 3))].CenterX(), lev[ToNumber(StrAt(singlelevelbuttons.ObjectName(), 3))].CenterY() for singlelevelbuttons
Repeat each instance for doublelevelbuttons
If Levels.[ToNumber(singlelevelbuttons.LabelText())] <= 0, Create [padlock] on lev[ToNumber(StrAt(doublelevelbuttons.ObjectName(), 3) + [StrAt(doublelevelbuttons.ObjectName(), 4))].CenterX(), lev[ToNumber(StrAt(doublelevelbuttons.ObjectName(), 3) + [StrAt(doublelevelbuttons.ObjectName(), 4))].CenterY() for doublelevelbuttons
Is this possible?