[quote=“khawtf,post:14,topic:324344”]
Oke I will try to show the problem so maybe someone can get me out of this headache that i am stuck with
I am making a bejeweld kind of game (not the same but has some stuff that is similiar)
i have all the objects in a 2d grid like this
grid[x][y]
the display object is in
grid[x][y].object
every 5 seconds i drop a icon off the screen (sometimes top sometimes bottom) to a open space (i check if there is a object or not)
the drop off is like this:
transition.to(iconObj, {transition = easing.linear, time=travTime,tag = iconObj.tagName, y = (gridObj.y + (gridObj.height \* .5)), onComplete=function(iObj) self.topGrid[dropX][dropIndex].active = true self.topGrid[dropX][dropIndex].iconObj = iObj self.topGrid[dropX][dropIndex].iconObj.y = iObj.y self.topGrid[dropX][dropIndex].iconKey = self.keyIcons[randomNr] end})
It works great but when i move a column up or down it goes horribly wrong
if i swipe up or down i move all the objects in the back with a function to the index up or down and i move a transition.to to move the display object to that position. It works great but when i do that with when a icon drops it goes to the predefined position in the transition.to but i already moved so sometimes it goes on top of another icon or it goes to a position that is empty…
I need to update the x or can i make sure that the transition to happens to the last object instead of a position i gave it before.
How can i fix this issue its killing me and it takes all the joy out of making a game hehe [/quote]
Oke so maybe I am going the wrong way with this because nobody can answer my questions…
Is this possible with box2d ?
-Give every icon a body
-Drop the icon with a push instead of transition
-Let the icon stop when it touches the other icon beneath it no one bounces or something like that ?