Need help with arranging actors positions?

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

  • SocksSocks London, UK.Member Posts: 12,822
    edited February 2015

    @Tiny_Ideas said:

    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 . . .

  • SocksSocks London, UK.Member Posts: 12,822
    edited February 2015

    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.

Sign In or Register to comment.