Note that there are some explanatory texts on larger screens.

plurals
  1. POandengine error connected with createBoxBody
    primarykey
    data
    text
    <p>I have little problem with my code... I'm learning physics and collisions in andengine and while I trying create some new object eclipse returns me error:</p> <blockquote> <p>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)</p> </blockquote> <p>I'm using andengine &amp; andenginephysicsbox2d extension... and i want to do sth like in example <a href="https://code.google.com/p/andengineexamples/source/browse/src/org/anddev/andengine/examples/PhysicsCollisionFilteringExample.java" rel="nofollow">andengineexamples</a></p> <p>Elipse returns me error even I change 'Texture' in to 'mgame_pandus' -> why? Maybe I downloaded bad package of andenginePB2D? If anybody could help me i will be very gratefull It's my code:</p> <pre><code>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; } </code></pre> <p>My whole code avalible on pastebin: <a href="http://pastebin.com/QPSWzagU" rel="nofollow">here</a> </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload