Making Lego-type actors.

ChimoruChimoru Member, PRO Posts: 137
edited March 2012 in Working with GS (Mac)
I'm trying to make a game where you have squares that can be attached to each other on top and bottom by dragging them with your finger. I have them moving on a grid using a ceiling and floor function, but I can't figure out how I would go about connecting them to each other from the top and bottom (like Lego pieces).

Any ideas?

Comments

  • POMPOM Member Posts: 2,599
    Connecting pieces is very difficult without joints , if you simply want the actors to "stop" in place upon collision , so once they collide with another square store their X and Y position to a "self" temporary attribute , then constrain their X and Y position to the values you just stored , this way it will appear as if they "sticked" together..

    Photobucket Roy
  • ChimoruChimoru Member, PRO Posts: 137
    Yeah I figured as much... I'm trying to make it complex enough so that when they connect they move together and they can't be floating without being connected to the ground or the top of the scene, but it's too bad I'll have to wait for joints to do this.
  • POMPOM Member Posts: 2,599
    edited March 2012
    You can make it , upon collision if you store the "center" brick X Y values , and your connecting brick X Y values , you can constrain few bricks to a center one with an offset .. and move them along together , rotation however will be tricky , honestly , i'd say wait for joints .
    good luck :)

    Photobucket Roy
  • ChimoruChimoru Member, PRO Posts: 137
    Alright I'll see what I can come up with. Thanks for the help!
Sign In or Register to comment.