Need help with arranging actors positions?
Tiny_Ideas
Member Posts: 326
Hello,
I have an issue which I am having trouble finding a solution too. As shown in picture below. I have five actors, all centred to be in the middle of the screen (relatively). Just like a list. Once one is touched it is destroyed, but the others need to move themselves (50 pixels) so they are still in the middle of the screen.
I am hoping there is a simple way to do this without using a ton of tables and behaviours. Any suggestions?
I am hoping there is a something I have just over looked that is simple to solve.
Thanks
Comments
Rule:
When touch is pressed destroy this actor
Rule:
When mouse position is less than self.position Y
And when mouse button is down
---Move To X0, Y-50 relative to actor
---Speed 333 / run to completion ✓
Rule:
When mouse position is more than self.position Y
And when mouse button is down
---Move To X0, Y50 relative to actor
---Speed 333 / run to completion ✓
. . . that should work just fine, I'll make you a quick demo to check . . . back in a second . . .
Here you go, it works just fine . . . . except that at moment you can click anywhere outside of the boxes and still destroy them so the code needs a little more work (you probably just need an extra rule that checks whether the mouse is over a box or not before triggering the rest of the rules) . . . but anyhow the rough maths idea is there - which is when a box is removed all the other boxes should move 50 pixels towards that recently killed box's position.