I want to create x instances of a sprite at random locations on the screen in a certain area, whereas x is a global variable. I also need to give each created instance different values for their private variables.
What I figured out so far (but doesn't work):
10 IF: button clicked
20 THEN: delete starsystem
30 IF: global('starsystem_creation_counter') is lower than global('number_of_starsystems')
40 THEN: starsystem set position x: random(1024) y: random(768)
50 IF: starsystem overlaps creation_area_sprite
60 THEN: starsystem: spawn starsystem
70 THEN: add 1 to global('starsystem_creation_counter')[/code:3878vfr1]
Instead of creating the number of starsystems/sprites it only creates one, and if I click another time, nothing happens at all and the one generated starsystem/sprite vanishes. I have no clue what is going on.
I also have no clue on how to make them 'unique' after their creation, so I can deal with them each for their own. Any help would greatly be appreciated.
PS: *.cap of what I've done so far. Ignore the other layout. http://dl.dropbox.com/u/12049513/Construct/GE/alpha.cap