HELP - Moving Display Group - ODD - results, Game thinks objects are still in original positions.

Why would a collision occur on an object that has been moved as part of a display group?

—>Ok here is the issue.

I am creating a platform style game ( yeah isn’t everyone )

I have created 15 ( one way platforms ) where the alien springs off of on collision ( works great ).

all platforms are part of group called “platformsGroup” - unique i know.

when the alien reaches a certain height in my collision event I perform the following transition

objT= transition.to( platformsGroup, { time=300, y=platformsGroup.y + yDiff})

( after the end of the collision i cancel the transition )

this all works fine the entire group transitions down the screen to give the appearance that the alien is jumping.

now here is the problem, even after the platformsGroup is transitioned down
the screen, the alien continues to jump in the same position. Thinking that he is having a collision with the same object ( even though nothing is there for him to hit )

I printed this debug info to confirm my idea, and as you can see he keeps hitting platform5 when its not on the screen, why is that?

object2->platform5-> y = 300
object2->platform5-> y = 300
object2->platform5-> y = 300
object2->platform5-> y = 300
object2->platform5-> y = 300

[import]uid: 11860 topic_id: 5395 reply_id: 305395[/import]

Physics only works right on objects in the same display group (this is mentioned in the documentation somewhere but don’t have time to lookup the link) [import]uid: 12108 topic_id: 5395 reply_id: 18081[/import]

All of the platforms are in the same display group, maybe I should put the alien in the same display group?

If even so, dosen’t moving the group of platforms cause each one of their x / y positions to change? [import]uid: 11860 topic_id: 5395 reply_id: 18088[/import]

Yes you have to put the alien in the same display group or you’ll have “unexpected” results.

The x and y doesn’t change because they are given in local coordinates with with respect to the parent (platformsGroup in this case). Since the children aren’t moving, only the parent is, their x and y pos wouldn’t change.

I think there’s a new API to find out the delta. When I had to do it in my game I had to get creative. [import]uid: 10835 topic_id: 5395 reply_id: 18095[/import]

All of the platforms are in the same display group, maybe I should put the alien in the same display group?

Or rather the other way around, don’t put the platforms into a separate display group and instead move each platform individually.

And incidentally this limitation is better than the alternative; if physics interactions worked between display groups then there wouldn’t be any way to move the scene around to see different sections of the level. [import]uid: 12108 topic_id: 5395 reply_id: 18098[/import]

After more testing I and still stuck.

I tried several ideas and could not get it working correctly YET!!

I understand about the platformsY position being local to the platformsGroup, but i don’t understand how the alien can hit colide with the platform that has been moved down the screen when the group was moved.

Adding the alien to the platformsGroup did not work because the alien does think he is higher than he really is on the screen so the group rolls right off the screen as the alien jumps up and down.

IgnacioIturra you said something about the delta position - i assume the delta of the platform. I searched the docs and could not find gettng the deltaY postion, and clues where i can find it? [import]uid: 11860 topic_id: 5395 reply_id: 18183[/import]

If the platforms were moving left and right, i could move the individually fairly easy ( actually in another game i am ), but i could have many platforms that need to scroll down the screen ( currently on the screen and not ) wouldn’t this take more redraw time to move each one of them say on a collision event?

I can do it in a loop processing a table with no problem but if everyone thinks that is a better solution.

I await your wisdom -> :slight_smile: lol

Thanks in advance larry [import]uid: 11860 topic_id: 5395 reply_id: 18190[/import]