Drag Multiple Squares

creativeappscreativeapps Member Posts: 1,770
edited July 2012 in Working with GS (Mac)
Hello,

I have 6 different green squares as per sample image and I want to drag all 6 square with single dragging and also want to drag skyblue area with are not detect collision. How do I do that? Please help me out.

image

Thanks,
John

Best Answer

  • OskarDeveloperOskarDeveloper Posts: 533
    edited July 2012 Accepted Answer
    I think you have to add or lower the amount of pixels on the y and x :D Do this on every actor: first calculate how far away from the touch you want it to be, then type that number of pixels after the constrain attr like this;

    - constrain attr: self.position.x to mouse.position.x (+ or -) [some # of pixels]

    - constrain attr: self.position.y to mouse.position.y (+ or -) [some # of pixels]

    if you want everything to move you can make a boolean attr and say when any of the actors is touched change boolean to true and when it is true the other actors that is not pressed should start moving.

Answers

Sign In or Register to comment.