I encountered a strange problem:
I have a map layer where my player sprite is in and I have another map layer for collision tiles (like the ground the player is moving on) and then I have another map layer for moving platforms. In the platform layers there are platforms which are groups containing platform tiles.
Now I want to put the player group (contains the sprite and some helper objects) into one of the platform groups when the player group is moved on a platform (means the player is walking on a platform).
This is what happens:
Once the player group is added to a platform group with
movingPlatform[1]:insert(groups.player)
the whole player group becomes invisible and not even groups.player:toFront() is working to bring it on top of this layer. The platform is in front and as I understand it the player group (now inside the same group) should get to the front with this command… but isn’t.
Now I wonder if the whole group handling using the map.layer should be done different than “normal” and if there are some things to think of when moving objects between layers, and groups inside the layers?
I can’t get this to work and it should be very easy… I just want to add the player group to the moving platform group as long as the player is standing on it, so it moves with the platform.