Spawning around a circle

krousty_batkrousty_bat Member Posts: 48
edited November -1 in Working with GS (Mac)
Hi

I'm trying to Spawn an actor randomly around a ball actor (so a circle), with of course my spawning circle being bigger (higher Radius or Diameter) than the 1st Ball, so they don't collide or touch or be on top of each other.

can someone help me to find the Mathematic formula I should enter in Spawning X and Y to do this ?

thx a lot

Comments

  • krousty_batkrousty_bat Member Posts: 48
    Here's the way I did it around a circle of Radius of 50 :)

    Create Object Attribute -> Random_X
    Create Object Attribute -> Radius

    Change attribute: Radius = 50
    Change attribute: self.Random_X = Random (-self.Radius,self.Radius)

    Spawn Actor
    X=self.Random_X
    Y=sqrt((self.Radius^2)- self.Random_X ^2)

    You can spawn every 0.1 seconds a dot or small actor first to see how it's working :)
    Just have to find a clever way to make it work on full circle now, for this is making it work on a Half circle.
  • krousty_batkrousty_bat Member Posts: 48
    I posted the results here,
    http://gamesalad.com/game/11536

    (to learn how to post and learn too :).
Sign In or Register to comment.