Is there anyway to script a group collectively?
This is what I'm working on.
[url=http://img166.imageshack.us/my.php?image=gamepreviewqh4.jpg][img=http://img166.imageshack.us/img166/198/gamepreviewqh4.th.jpg][/url]
Each piece is made up of four blocks that are cloned then grouped together.
Using the "I" piece as example:
I0_0 is set as the parent
I1_
I2_
I3_
Group is set to shapeI_0 for each item.
First cloned piece is
I0_1
I1_1
I2_1
I3_1
Group "shapeI_1"
The cloned object is cloned within the game grid.
Being able to script each group independently would save significant coding.
There are four rotation movements like this:
Sub Rotate1
desktopx.object("I1_1").Left = desktopx.object("I0_1").Left
desktopx.object("I1_1").Top = desktopx.object("I0_1").Top + 31
desktopx.object("I2_1").Left = desktopx.object("I1_1").Left
desktopx.object("I2_1").Top = desktopx.object("I1_1").Top + 31
desktopx.object("I3_1").Left = desktopx.object("I1_1").Left
desktopx.object("I3_1").Top = desktopx.object("I2_1").Top + 31
End Sub
There are three position movments like this:
Sub MoveDown
desktopx.object("I0_1").Top = desktopx.object("I0_1").Top+31
desktopx.object("I1_1").Top = desktopx.object("I1_1").Top+31
desktopx.object("I2_1").Top = desktopx.object("I2_1").Top+31
desktopx.object("I3_1").Top = desktopx.object("I3_1").Top+31
End Sub
Being able to script the groups will eliminate eight lines of code in the above examples alone. Any input or ideas are greatly welcome.
PS. Theres only one image being used at 354 bytes.