android - Andengine - any missing FPS causes other scene entities to slightly shake as it chases a fast entity -


i creating andengine game , copied smoothchasecamera class andengine development book bought.

package com.killercoolgames.djdestiny.custom.andengine;  import com.killercoolgames.djdestiny.mainactivity; import org.andengine.engine.camera.smoothcamera; import org.andengine.entity.ientity;  public class smoothchasecamera extends smoothcamera {  private static final mainactivity main_activity = mainactivity.getinstance();  private ientity chaseentity;  public smoothchasecamera(float x, float y, float width, float height) {     super(x, y, width, height, 3000f, 1000f, 1f); }  @override public void setchaseentity(ientity chaseentity) {     super.setchaseentity(chaseentity);     this.chaseentity = chaseentity; }  @override public void updatechaseentity() {     if( chaseentity != null ) {         // follow entity , camera's centery ahead of entity.         setcenter(getcenterx(), chaseentity.gety() + main_activity.camera_height / 3);     } }  @override public void reset() {     super.reset();     set(0, 0, main_activity.camera_width, main_activity.camera_height);     setcenterdirect(main_activity.camera_width / 2, main_activity.camera_height / 2); }  } 

it work correctly , , when turn off parallax layers , collision detection in game, run @ 59.80 fps or higher on real samsung galaxy tab 4 device. if make chaseentity have high velocity of 300f or higher. entity moving pretty fast , camera follow it, notice jut/shake occur every second on entities on scene except chased entity. if reduce velocity down 50f or less, still same fps, because going slower, not notice shake @ all. believe camera following correctly, because there no jittering when looking @ chased entity, if @ other objects in scene, jitter camera moves.

the problem need entity go fast because flying fast, , level should end when hits y. ive tried adjusting other entities in scene account speeds. ive tried slowing down player , increasing enemies speed , issue still occurs. creating game flying upwards move past enemies in scene. camera super smooth following entity chasing always. other entities in scene seem not updating smoothly.

i have tried disabling see if hit 60fps , think not possible hit everytime, makes sense. think camera causing issue not sure. moment start turn other stuff on in game, lag go abit 59.50 fps or higher still stay same around 59.80 consistently stuff on, , kind of tells me camera not being able keep up. case? how fix this?

after doing debugging today, believe lagging fps left not make 60fps causing lag. not sure how fix this. using physicshandler update sprites position camera follow. tried doing movemodifier , still had same issue. cannot figure out way keep camera moving upwards smoothly.

i tried doing fixedstepengine , that, make lag consistent never rid of it. there worse when switching fixedstepengine.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -