I am currently facing a problem.
What I'm trying to achieve.
Mating sprites randomly along another x axis and the same y axis, but sprites do not intersect.
Question
Sprites intersect and in some cases spawn more than once in one place.
Your suggestions have been largely received.
what am i doing now
for (int spawn = 0; spawn < 10; spawn++) {
SKSpriteNode *obstacle = [self createEnemyRed];
obstacle.anchorPoint = CGPointMake(0.5, 0.5 );
obstacle.position = CGPointMake(RandomFloatRange( 0, self.size.width),
bg.size.height/2 );
obstacle.name = @"obstacle";
[bg addChild:obstacle];
}
source
share