This project has moved and is read-only. For the latest updates, please go here.

Collision control problem

Topics: Developer Forum, User Forum
Feb 28, 2011 at 7:52 PM

Hey, I've been trying to mess build a game that allows the user to move fixtures around the screen with the mouse and a fixed joint. When the user clicks and holds the left mouse button the user "Has" the fixture in his hand. As he drags it across the screen it should not collide with the other fixtures, BUT if the held fixture (bodytype = Dynamic) overlaps a fixture on the screen (bodytype = static), print an X over the fixtures. But when the held fixture no longer overlaps the static fixture on the screen, turn the X off.

        public bool CharacterOnCollision(Fixture fixtureA, Fixture fixtureB, Contact contact)
            fixtureA.IsColliding = true;
            return false;

The issue i'm having is when the held fixture is moved off the other fixture, Onseparation isn't called so the X never comes off the screen.

        private void CharacterOnSeparation(Fixture fixtureA, Fixture fixtureB)
            fixtureA.IsColliding = false;

I need the high accuracy collision logic for this part of the game as well as keeping my fixtures how they are. Can i use something like aftercollision or something to solve this?



Mar 3, 2011 at 5:22 PM

Solved it.

mod can delete/lock/what ever