Drag Multiple Squares
creativeapps
Member Posts: 1,770
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.
Thanks,
John
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.
Thanks,
John
Best Answer
-
OskarDeveloper Posts: 533I think you have to add or lower the amount of pixels on the y and x 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
http://gshelper.com/constrain-to-mouse-and-keep-collision-gamesalad/
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx