使用 AndEngine,我想移动一个对象,所以我创建了一个 Sprite:
tower1 = new Sprite(50, 150, this.tower1TextureRegion,
this.getVertexBufferObjectManager());
tower1Body = PhysicsFactory.createBoxBody(physicsWorld, tower1,
BodyType.KinematicBody, towerFixtureDef);
this.physicsWorld.registerPhysicsConnector(new PhysicsConnector(tower1,
tower1Body, true, true));
然后定义移动:
moveTower1 = new MoveXModifier(actualDuration, tower1.getX(), -150f)
{
@Override protected void onModifierFinished(IEntity
removeTower(tower1); }
};
tower1.registerEntityModifier(moveTower1);
当我运行这个应用程序时,精灵在移动,但物理对象没有。我做错了什么?