Tell me more ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I can't make body(box2d) a spite(andengine) and at the same time i wanna apply MoveModifier to sprite which is body.if i can make just body,it works namely the srites can collide.if i can apply just MoveModifier to sprites,the sprites can move where i want.but i wanna make body(they can collide) and apply MoveModifier(they can move where i want) at the same time.How can i do? this my code just run MoveModifier not as body at the same time.

    circles[i] = new Sprite(startX, startY, textRegCircle[i]);
    body[i] = PhysicsFactory.createCircleBody(physicsWorld, circles[i], BodyType.DynamicBody, FIXTURE_DEF);
    physicsWorld.registerPhysicsConnector(new PhysicsConnector(circles[i], body[i], true, true));
    circles[i].registerEntityModifier(
            (IEntityModifier) new SequenceEntityModifier (
                        new MoveModifier(10.0f, circles[i].getX(),  circles[i].getX(), 
                                circles[i].getY(),CAMERA_HEIGHT+64.0f)));
    scene.getLastChild().attachChild(circles[i]);
    scene.registerUpdateHandler(physicsWorld);
share|improve this question

1 Answer

I think you cannot apply move modifiers on physics bodies. If you want to move bodies, you have to use other methods like force, impulse or setting velocity.

share|improve this answer
Moving the body directly should be possible with a kinetic body. Although kinetic bodies have other downfalls. – bummzack Jan 21 at 12:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.