I want to create random instances but with some rules :
1- instances should be the same copy of the original object (no change in size).
2- instances have the same Y value (raw of instances).
3- X value of each one should be the multiply of the instance width (for example 160 pixel).
4- no 2 instances should be created overlapping each other.
the result of that should be a raw of instances at certain positions arranged randomly like this for example
(instance - space - space - instance - instance - instance - space - instance - space - space - space - instance) etc.
each instance and each space should have the same width and aligned to each other.
in the game I'm working on I'm creating columns passing the screen (scrolling) and destroyed when they become outside the layout as they left the right side of the screen, but i need them random.
i tried using "choose" like this :
if instances count < 2 ---------> create instance at : y=240, X= Choose (160,320,480,640)
but it didn't work as i want, C2 may create 2 instances on each other.
I'm not familiar with arrays and still trying to understand them, so for now what can i do to achieve this ?
thanks