有没有办法在多个位置随机生成,例如,我有四个SKSpriteNode
s,它们是我希望另一个节点在其中生成的位置。
这些是我希望新节点生成的位置:
//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)
当它们在该位置生成时,为什么要让它们在该 SKSpriteNode 内的随机位置生成?(我正在使用 swift 和 spritekit 游戏文件)
谢谢