Updating a transition that is already active

Lets say i have a grid that moves if a user touches the grid and every 3 or 4 seconds a icon fly’s in with a transition.to 

It works great but when a user moves the column and the transition is busy…it goes to a x that was empty when the code was checking it but after that the user moved a icon to it now its “full” 

so how can i make sure it updates to go to the element before it…?

Can you call a transition.cancel, store x,y positions and then make a new transition.to ?

So you are saying i have to cancel it (i tried it with tag and its workings so i can do that) but the problem is the object is already in the view…it has to go on and not dissapear or stop…

Hmm should i clarify it more ? maybe transition to is not the best way ?

Is this such a tough question ?

No one ever updated a transition that is already going ?

If you cancel a transition on an object and then give it another one it won’t stop or vanish.

In the game I’m working on I have enemies roaming around a grid-based playing field. It looks like they are just roaming around, but they only ever go from the center of one square to the center of a touching square. When they get there, a routine is called to determine whether they can/should turn or continue going straight. Based on that a new transition is put on that object.

It sounds like you’d see the guys stopping and starting all over the place, but you don’t. It’s just smooth animation.

 Jay

So I need to cancel it and do another transition to it ?

Can’t i do something like this ?

In a function I have this:

transition.to( object, { time=300, alpha=1, tag= “moveObject”, x=500, y=50, onComplete= end } )

I have a function that I want to use to update the transition when it’s still “alive”.

Function updateObject(tagname)
–update the transition.to x with +50

End

Is this possible ?

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=“khawtf,post:7,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 ?

Can you call a transition.cancel, store x,y positions and then make a new transition.to ?

So you are saying i have to cancel it (i tried it with tag and its workings so i can do that) but the problem is the object is already in the view…it has to go on and not dissapear or stop…

Hmm should i clarify it more ? maybe transition to is not the best way ?

Is this such a tough question ?

No one ever updated a transition that is already going ?

If you cancel a transition on an object and then give it another one it won’t stop or vanish.

In the game I’m working on I have enemies roaming around a grid-based playing field. It looks like they are just roaming around, but they only ever go from the center of one square to the center of a touching square. When they get there, a routine is called to determine whether they can/should turn or continue going straight. Based on that a new transition is put on that object.

It sounds like you’d see the guys stopping and starting all over the place, but you don’t. It’s just smooth animation.

 Jay

So I need to cancel it and do another transition to it ?

Can’t i do something like this ?

In a function I have this:

transition.to( object, { time=300, alpha=1, tag= “moveObject”, x=500, y=50, onComplete= end } )

I have a function that I want to use to update the transition when it’s still “alive”.

Function updateObject(tagname)
–update the transition.to x with +50

End

Is this possible ?

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=“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 ?