-1

i have been looking around the Internet to find out how to spawn Enemy Sprites at rondom, in a random place, I'm making a game that involves a sprite jumping an it has to dodge these 'Enemy' sprites or objects blocking it's path.

If anybody has any idea on how to do this could you please help me? Thanks in advance!

  • Alfie
user2501236
  • 11
  • 1
  • 2

1 Answers1

0

You use objective-c's random number functions to create a random position...

sprite.position = ccp( arc4random_uniform( 800 ), arc4random_uniform( 600 ) );
dqhendricks
  • 19,030
  • 11
  • 50
  • 83