I am running into a strange problem that I am hoping someone can help me with.
I have a bunch of objects that have collision shapes associated with them that I have placed in a display group. I also have a player object that remains in the center of the screen that I am attempting to detect the collisions of the other, grouped objects.
Basically, I move the group around and attempt to detect the collisions. In theory, I thought that this would work. In practice, it does not. It seems that the collisions are happening based on the x and y coordinates of the objects in relation to the group, not to the objects as they appear on screen. For example, let’s assume the player character is at center x and center y. Within the objects group are 2 objects, 1 at center x and center y+100 and number 2 at center x and center y + 200.
I start the game with the whole group translated by -100 on the y axis. Onscreen, the player is hitting the second object but in the physics engine, the player is hitting the first object.
Does anyone have any idea how I can fix this?
I hope that I have presented the problem in a way that makes sense.
Thanks,
Alan