android - What is position of Scene, Velocity property in PhysicsHandler? -


I'm starting Android programming with the endengine framework. And I learn with tutorials on the internet. I do not know that I am wrong about the wrong position about the property of scans and velocity in PhysicsHandler.

here: Enter image details here

And if I The opinion is true. Thus, how to set the velocity property of physics handler to follow the status of the scene?

This is my example: Enter image details here

and my code:

  scene.setOnSceneTouchListener (new IOnSceneTouchListener () {@Override public boolean onSceneTouchEvent (visual pScene, TouchEvent pSceneTouchEvent) {if (pSceneTouchEvent.getAction () == TouchEvent.ACTION_UP) { PositionUpX = pSceneTouchEvent.getX (); positionUpY = pSceneTouchEvent.getY (); ball = new ball (status download x, positiondoni, position opxx, positioning event, mfaetector project, getVertexBufferObjectManager ()) ;attach child (ball); return if; Pscnt t Cavt. Gate action () == Tcavent. Akshn_ DOWN) {positionDownX = pSceneTouchEvent.getX (); Sthitidaunwai = pSceneTouchEvent.getY (); return true;} return false;}}); Private static class ball provides animated features {Private financeHandlerMfshixHandler; Public Ball (Last float PDX, Final float padony, // start float PITX, final float PTY, and final tile fragmentation regulation PT radiation, final vertexbuffer object maner Pewterxbuff object manager) Super (Paidunx, PDANI, PTATATION, PVATxbuff object managers); This.mphysicshandler = New physics handler (this); This.registerUpdateHandler (this.mPhysicsHandler); This.mphysicsHandler.setVelocity (PUTx, PPE); } @ Override update protected manage zero (final float Pisekands Apsd) {if (Yh.amaks & lt; 0) {this.mphysicsHandler.setVelocityX (BALL_VELOCITY); } And if (this.mx + this.getWidth ()> CAMERA_WIDTH) {this.mphysicsHandler.setVelocityX (-BALL_VELOCITY); } If (this: ME & Lt; 0) {this.mphysicsHandler.setVelocityY (BALL_VELOCITY); } And if (this M.I. + this.getHyight ()> CAMERA_HEIGHT) {this.mphysicsHandler.setVelocityY (-BALL_VELOCITY); } Super.onManagedUpdate (pSecondsElapsed); }}    

I have found the answer

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -