question about moving actors like Move The Box

Hi there, I'm trying to figure out how to make 4 squares moving like Move The Box, in other words i have 4 similar squares in a column, i would like that when i touch the one on the top, for example, and drag it down to a 2nd quare underneath it, this last square moves up while the 1stone moves down, following my finger. and when the first square gets to 2nd square position it has to stop there, while 2nd square stops at 1st's position Y.
well, I hope somebody can give me some suggestion, I think it'll be helpful for a lot of other people :)

Best Answers

  • CORE GameCORE Game Posts: 280
    Accepted Answer
    It can be done in many ways,
    Method 1:
    1-create a public attribute for each position (considering that you have 4x4 grid).
    2-create 2 more public attributes to save the starting position and destination position.
    3-When you touch a box it should save the position in the starting position attribute and when touch the destination it should save it in the destination attribute, now simply tell your actors to move accordingly.

    Method 2:
    Do it exactly as described above, but instead of using attributes for the grid, use tables, you can create the table as following:

    GridPosition X Y

    This way you can easily let your actors moves to the position coordinates .

    Let me know if it works with you

  • CORE GameCORE Game Posts: 280
    Accepted Answer
    glad that I helped.

Answers

Sign In or Register to comment.