Placing an Object in the Center of Two Actors

thatfoolseanthatfoolsean Member Posts: 4
edited July 2012 in Working with GS (Mac)
Okay, so I asked a question yesterday, but I think I was asking the wrong question. This is the right one. I think :)

I am trying to make a game that features 2 players. Each player controls an actor (seen in the below screenshots as a red and blue square). When the player touches a square, they can move it with their finger anywhere on screen. I want to make it appear as though each of the squares is holding a "log" or pipe, with each square holding one side on the log.

In order to make this look right, I think that I need to have an algorithm that constantly keeps the "log" actor in between the two "square" actors (or player avatars). The log would always create a straight line that connected both of the squares, so the angle would have to be adjusted as well.

I am absolutely terrible at geometry, so I don't know exactly what this algorithm would look like, or if this is the right approach. I have attached some screens that I have mocked up that I hope demonstrate what I am trying to do, if anyone has any tips, I would be incredibly appreciative.

Thanks,

Sean

http://www.flickr.com/photos/thatfoolsean/

Best Answer

  • RThurmanRThurman Posts: 2,881
    Accepted Answer
    Same answer as yesterday.

    When three objects are welded together and move together they are one object.

    Make a graphic of the three objects and place the image in an actor. Then set up the actor with the behaviors that you need for both players to pull the same actor around the scene.

Answers

  • thatfoolseanthatfoolsean Member Posts: 4
    Aaah, that makes sense, I was completely reading it wrong before. Thanks for your help, sorry you had to answer twice! :)
Sign In or Register to comment.