Using Groups

I am getting some strange behavior when I use display groups.
I have defined 3 groups. The first group holds a large background image. The second group includes an image of my “player”. The third group includes foreground graphics like clouds.

I use “transition to” on the first and third groups to make the background and foreground objects scroll in unison. What is odd, however, is that the objects in the second group are displayed on top of the objects in the third group… even though I define the third group and add objects to the third group after I define and populate the second group… does this make sense? I would have expected the objects in the second group to cover the objects in the first group but be hidden behind objects in the third group.

Is this what is supposed to happen?

Thanks!

[import]uid: 16901 topic_id: 11984 reply_id: 311984[/import]

Solved… for some reason I have to reset my foreground layer to the front after I issue the transition command… so:

[code]
transition.to(fgGroup, { time=baseMovementTime, delay=1000, delta=1, y=travelTo, onComplete=nil});
fgGroup:toFront() [import]uid: 16901 topic_id: 11984 reply_id: 43697[/import]

i always like to create a mainGroup and insert all the other groups into this group that way i can keep them in order and change the order if needed
ex. you may want your player group to sometimes be in front of your foreground group to give more depth to the scene [import]uid: 7911 topic_id: 11984 reply_id: 43728[/import]

Good advice jstrahan…

One more question… is it possible to detect collisions between objects that are in different groups (i.e, on different layers)?

Thanks!
[import]uid: 16901 topic_id: 11984 reply_id: 43801[/import]