I haven’t had much experience working with the physics engine, though I have used it on occasion for special effects and animations. I’m now working on a project that’s more physics-oriented and am having an issue.
I attached an image with the post. I have the player object (top-most dynamic rect) and have ground (bottom rows, static) that seem to have the physics attached to them properly in debug mode, but the player falls right through the ground every time. I have a global listener for collision events and it doesn’t even seem to get called as the player passes through them, either.
One thing I thought was maybe since I was calling physics methods in different files, it was messing up somehow. So that middle rect I’m creating in the same file and area where the ground is being created as a test, and as you can see the player’s physics body collides and is stopped by it as it should be, and I’m seeing the collision function being called from that happening. I’m also calling physics.start() first thing in the :create() scene function before anything else happens.
I also tried making the ground tiles dynamic for the heck of it, and though they were affected by gravity they still didn’t collide with the player or with each other (visually), BUT it did fire the collision listener. I’m wondering if anyone has any other ideas?
The only physics methods I’m using at the moment is start, setDrawMode, setGravity, and addObject. I’m not even modifying the attributes of the physics objects yet, either, so all I’m doing is displaying images on screen and converting them to physics objects at the moment.
