faisalrasheed / andengine

Automatically exported from code.google.com/p/andengine
0 stars 0 forks source link

Collision detection failing; Slow framerate caused by non-on-screen shapes #3

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. From org.anddev.andengine.examples package open BasePhysicsJoinExample.java.
2. Modify onLoadScene() by removing anything involving the "Shape ground" 
object. This will cause a hole in the floor.
3. Run the application from the emulator.
4. From the application, go to "Physics", 
5. Go to "Using a RevoluteJoint"
6. Continuously click on the screen, until the below issues are observed. 
(Click 100 times).

==============================================

What is the expected output? 
1. A continuously smooth framerate is expected.
2. The shapes created from the user's touch are expected to collide with the 
revolving bodies.

==============================================

What do you see instead?
1. The frame rate drops to about 1 fps as more objects are created even though 
they are falling off screen.
2. The shapes created from the user's touch pass through the revolving bodies, 
instead of colliding. 

==============================================

What version of the product are you using? On what operating system?
Android emulator. API Level 8. Platform 2.2.

==============================================

Please provide any additional information below.

It appears as though the collision detection system is not able to keep up with 
the large number of moving objects within acceptable time so the falling object 
moves through the revolving object without a collision. Sometimes a collision 
happens when the two shapes are completely on top of one another.

Original issue reported on code.google.com by Glenn...@gmail.com on 14 Aug 2010 at 2:46

GoogleCodeExporter commented 8 years ago
Hello .
i have tried to make a simple game of balloon shoot using andengine and in game 
i have fall down baloon successfully but when i have  going to shoot the 
balloon through the another object of bullet then i can shoot only one object 
of balloon which i had taken static ..but i had taken array of balloon and 
falling it using for loop..so in the for loop how can i use the 
"registerUpdateHandler"  
my balloon code is following ..

  for(int i=0;i<10;i++)
                 {
                    pX[i] = random.nextInt(CAMERA_WIDTH-1);
                    pY[i] = 0;
                    balloonArray[i]=new Balloon(pX[i]+20, pY[i], this.mBallTextureRegion);
                     balloonArray[i].setVelocity(i+10, 40+i);
                     scene.getTopLayer().addEntity(balloonArray[i]);

                 }
please give me solution ..

Original comment by dharam.i...@gmail.com on 23 Sep 2010 at 4:41