Limiting the distance from centre

mdtajghorimdtajghori Member Posts: 24
edited May 2012 in Working with GS (Mac)
Hey guys, I have an actor and I've set it's coordinates to constarin the coordinates of the mouse upon clicking the actor. Now I want to limit the movement of the actor to within a specified radius, say 100 pixels from the centre (0,0). How do I do this?

What I'm trying to make is a 360 degree slingshot with no gravity but the acceleration of the actor depends on the distance of the actor (upon being pulled by the mouse) from the centre (0,0). I've tried following the 'Angry Birds Template' but in vain as my actor doesn't want to move upon being clicked by the mouse. Any detailed help would be much appreciated!

Best Answer

Answers

  • mdtajghorimdtajghori Member Posts: 24
    Thanks a lot! I got the actor to remain within a specified radius from the centre upon being touched. I did ran into a small issue. When the actor reaching the perimeter of the circle and the mouse/touch reaches outside the perimeter, the actor gets stuck on the boundary at the same coordinates until the mouse/touch is brough back inside the perimeter (and then it follows the mouse within the circle without any issues). Any ideas as to why the actor gets stuck at the same coordinates?
  • mdtajghorimdtajghori Member Posts: 24
    Ok got everything to work. Problem was the mac client....everything works perfectly on windows beta client
Sign In or Register to comment.