Hello,
I'm making a function to create objects called SPRITE in the start of the layout. The function is supposed to test if another SPRITE is too close to the supposed spawn point before creating another SPRITE in the spawn point.
The function has Spawn.X and Spawn.Y parameters. These are changed by a loop that runs before the function and that part works fine.
So this is how i'm trying to set up the spawning:
Conditions:
SPRITE.NUMBER = 0
Action:
Create SPRITE at Spawn.X, Spawn.Y
(this is to spawn the first SPRITE and this part works correctly).
Conditions:
SPRITE.NUMBER > 0
1. Pick all SPRITE
2. Use system condition compare two values: Distance(0,SPRITE.Y,0, Spawn.Y) < desired minimal Y distance.
3. Use system condition compare two values: Distance(SPRITE.X,0,Spawn.X,0) < desired minimal X distance.
4. PickedCount = 0
Action:
Create SPRITE at Spawn.X, Spawn.Y
Only the first SPRITE is created. When I toggle disabled the conditions the function works just fine. It's just that I can't seem the function to properly evaluate the spawn point distance to the previously created SPRITEs. I have also tried replacing the compare two values conditions with the pick by evaluate system condition with no luck.
Thanks for help!