Is there a way to spawn randomly in multiple positions for example, I have four SKSpriteNode
s which are the locations of where I would like another node to spawn inside of.
These are locations of where I would like the new node to spawn:
//bluesquare
self.bluesquare.position = CGPoint(x:90, y:400)
//greensquare
self.greensquare.position = CGPoint(x:290, y:400)
//yellowsquare
self.yellowsquare.position = CGPoint(x:90, y:150)
//redsquare
self.redsquare.position = CGPoint(x:290, y:150)
When they spawn within the location is there a why to make them spawn in random positions within that SKSpriteNode? (I am using swift with a spritekit game file)
Thanks