calculate the center of an object

toki6toki6 Member Posts: 40
edited April 2012 in Working with GS (Mac)
hello guys, can you help? in this project, the view is from the top, and have a ball moving on a platform. how do I drop the ball if the platform goes beyond their own half? I hope I was clear and excuse my horrible English! thanks

Answers

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    to find the centre of an actor it will be

    so then you can do self.position.x-self.size.width/2

    If i'm not mistaken this would find the left side of the actor and self.position.x+self.size.width/2 would find the right side of the actor etc…

    Your x and y positions are the center

    I could be misunderstanding both the question and answer given. If so just ignore me. :)
  • toki6toki6 Member Posts: 40
    in practice if you are on the edge the precipice, and I cross my center, I fall, that's what I'm trying to do, but I do not know how to do it, you could not give me an example? thank you very much
  • toki6toki6 Member Posts: 40
    no example guys???please :(
Sign In or Register to comment.