Android 与createBoxBody连接的andengine错误
我的代码有点问题。。。我正在学习andengine中的物理和碰撞,当我尝试创建一些新对象时,eclipse返回错误: 无法将主体解析为方法中的变量 createBoxBodyPhysicsWorld,IAreaShape,BodyDef.BodyType,FixtureDef 在类型中,PhysicsFactory不适用于参数 物理世界,形状,BodyDef.BodyType,FixtureDef 我正在使用andengine&andenginephysicsbox2d扩展。。。我想做一些类似于例子中的事情 Elipse返回错误,即使我将“纹理”更改为“mgame_pandus”->为什么? 也许我下载了一个坏的andenginePB2D软件包? 如果有人能帮助我,我将非常感激 这是我的密码:Android 与createBoxBody连接的andengine错误,android,andengine,Android,Andengine,我的代码有点问题。。。我正在学习andengine中的物理和碰撞,当我尝试创建一些新对象时,eclipse返回错误: 无法将主体解析为方法中的变量 createBoxBodyPhysicsWorld,IAreaShape,BodyDef.BodyType,FixtureDef 在类型中,PhysicsFactory不适用于参数 物理世界,形状,BodyDef.BodyType,FixtureDef 我正在使用andengine&andenginephysicsbox2d扩展。。。我想做一些类似于
protected Scene onCreateScene() {
Scene scene = new Scene();
ParallaxLayer parallaxLayer = new ParallaxLayer(camera, true, 4000);
Sprite Srace_theme = new Sprite(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT, mrace_theme, this.getVertexBufferObjectManager());
parallaxLayer.setParallaxChangePerSecond(2);
parallaxLayer.setParallaxScrollFactor(1);
parallaxLayer.attachParallaxEntity(new ParallaxEntity(-110, Srace_theme, false, 1));
final FixtureDef RectFixtureDef = PhysicsFactory.createFixtureDef(0, 0.0f, 0.0f);
scene.attachChild(parallaxLayer);
PhysicsWorld physics_world = new PhysicsWorld(new Vector2(0,0), false);
scene.registerUpdateHandler(physics_world);
final FixtureDef objectFixtureDef = PhysicsFactory.createFixtureDef(1, 0.5f, 0.5f);
final Shape Texture = new Rectangle(0,CAMERA_HEIGHT-2,CAMERA_WIDTH-2, 2, this.getVertexBufferObjectManager());
PhysicsFactory.createBoxBody(physics_world, Texture, BodyType.KinematicBody, RectFixtureDef);
// - Body cannot be resolved to a variable
// - The method createBoxBody(PhysicsWorld, IAreaShape, BodyDef.BodyType, FixtureDef) in the type PhysicsFactory is not applicable for the
// arguments (PhysicsWorld, Shape, BodyDef.BodyType, FixtureDef)
return scene;
}
我的全部代码都可以在pastebin上找到:我想你正在使用GLES1分支库。从link下载最新的GLES2分支库不幸的是,我有这些版本的andengine->GLES2。对不起,我迟了回答。。。这个话题还没有解决