[Beta] RSAndEngine - Beta testers/Sample writers needed

NFOBoy

Active Member
Licensed User
Longtime User
1. I haven't added the Update method to the physicshandler.
This is because i followed a tutorial, but i couldn't find a lot of information about physicshandler. Is there a way you can show me some information about the physicshandler _update event?

I will try to find some information about that.


2. Can you explain what you mean?

Sure, if you run the sample, it should happen there as well. What happens is, the ball actually will "sometimes" stick to the wall that it is hitting, and then "sometimes" bounces like you would expect and "sometimes" it actually gets stuck in the wall it is touching and will start to vibrate or "tunnel" through the wall.

This could be addressed by resetting the position of the sprite based, but, I'm just trying to write the samples as shown in the AndEngine samples, and there appears no need to do that in those samples.

In the AndEngine code, it handles the check for the moving ball in here:

B4X:
private static class Ball extends AnimatedSprite {
      private final PhysicsHandler mPhysicsHandler;

      public Ball(final float pX, final float pY, final TiledTextureRegion pTextureRegion, final VertexBufferObjectManager pVertexBufferObjectManager) {
         super(pX, pY, pTextureRegion, pVertexBufferObjectManager);
         this.mPhysicsHandler = new PhysicsHandler(this);
         this.registerUpdateHandler(this.mPhysicsHandler);
         this.mPhysicsHandler.setVelocity(MovingBallExample.DEMO_VELOCITY, MovingBallExample.DEMO_VELOCITY);
      }

      @Override
      protected void onManagedUpdate(final float pSecondsElapsed) {
         if(this.mX < 0) {
            this.mPhysicsHandler.setVelocityX(MovingBallExample.DEMO_VELOCITY);
         } else if(this.mX + this.getWidth() > MovingBallExample.CAMERA_WIDTH) {
            this.mPhysicsHandler.setVelocityX(-MovingBallExample.DEMO_VELOCITY);
         }

         if(this.mY < 0) {
            this.mPhysicsHandler.setVelocityY(MovingBallExample.DEMO_VELOCITY);
         } else if(this.mY + this.getHeight() > MovingBallExample.CAMERA_HEIGHT) {
            this.mPhysicsHandler.setVelocityY(-MovingBallExample.DEMO_VELOCITY);
         }

         super.onManagedUpdate(pSecondsElapsed);
      }
   }
}

So think you would need to expose the onManagedUpdate (which is what it looks like the PhysicsHandler Update should be)


What walter meant was that if you have a sprite covering the scene, that that sprite will receive the touch events rather then the scene.

That I understand, but I do not have any sprites loaded when I have tried getting the Scene_AreaTouched to fire.

I have never been able to get it to fire, even if only the scene is loaded and the listener is set.

However, if I set Scene.setOnAreaTouchListener, (and not the Scene.setOnSceneTouchListener), the SceneTouched Event is fired, which I don't think is what you are looking for to happen.

I'll try to find a solution to it and i might contact the AndEngine author.
Ross and Walter, is it possible to both post the logs until you receive the "bug/error"?

My error log is posted above for my S3, as I said, the SL does not give an error... it just quits and resets... D'oh!


Ross
 
Top