Wednesday, 15 July 2015

sprite kit - Create random CGPoint with Swift -



sprite kit - Create random CGPoint with Swift -

so, i'm trying develop simple game written in swift, i'm having problem doing pretty simple thing. can't manage create random cgpoint... when using arc4random, compiler error shows telling me can't utilize int32 in cgpoint. so, there way this? workaround? thanks!

hi constructing int? int(arc4random())

e.g.

var p = cgpoint(x:int(arc4random()%1000),y:int(arc4random()%1000))

swift sprite-kit cgpoint

No comments:

Post a Comment