Note that there are some explanatory texts on larger screens.

plurals
  1. POonManagedUpdate never changes pSecondsElapsed - AndEngine
    primarykey
    data
    text
    <p>I have a Sprite, which is a ball, and it is falling properly, acording with my FixedStepPhysicsWorld options. But I would like a vector follow this ball as it is falling. So I decided to override the onManagedUpdate sprite's method.</p> <p>After lots of tests, I just got 1 vector drawn, then I realized that the pSecondsElapsed, were not being incremented.</p> <p>Here is my code:</p> <pre><code>@Override public void onPopulateScene(Scene pScene, OnPopulateSceneCallback pOnPopulateSceneCallback) throws Exception { sPlayer= new Sprite(200,0, playerTextureRegion, this.mEngine.getVertexBufferObjectManager()){ @Override protected void onManagedUpdate(float pSecondsElapsed) { super.onManagedUpdate(pSecondsElapsed); Log.d("&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;,&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;"+pSecondsElapsed+",""); } </code></pre> <p>The output is the following:</p> <pre><code>11-07 21:14:32.242: D/&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;,&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;0.02 (23720): [MainActivity.java:359:onManagedUpdate()] 11-07 21:14:32.257: D/&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;,&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;0.02 (23720): [MainActivity.java:359:onManagedUpdate()] 11-07 21:14:32.281: D/&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;,&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;0.02 (23720): [MainActivity.java:359:onManagedUpdate()] </code></pre> <p>My Engine is like:</p> <pre><code> @Override public Engine onCreateEngine(final EngineOptions pEngineOptions) { return new FixedStepEngine(pEngineOptions, 50); } </code></pre> <p>QUESTION: 1 - Why pSecondsElapsed is not changing? 2 - I want to draw vectors for each position of this ball. Should I detach and atach a new Line each time this method(onManagedUpdate) is called?</p>
    singulars
    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