Hey guys, sorry if this is a newb question for most, I’m just trying to wrap my head around the concept.
Say you have a 5x5 grid of squares 100x100, each with event listeners for tap events. You make one of the squares disappear by removeSelf or isVisible. Each square can move into the empty space, so as long as its adjacent to it, so when a square moves, it leaves an empty space which can be taken by other square. The point is, you would use transition.to to move the squares, not the .alpha property.
How would you calculate the x and y for the empty space in order to transition the other pieces? Would it be a matter of saving current x and y before the tapped square is moved (tap function called), or is more like using math to calculate the position by using x and y after the square has moved? Or maybe something else entirely? I’m just trying to figure it out on my own, that’s why I didn’t post any code. Just want to make sure I understand the concept or how you would do it in Corona and try to come up with the code myself.
Appreciate any comments. Thanks!