0
votes

I have a Sprite in Andengine. When I use first code below, it's working and displaying on scene and rotating. But when I use sprite's onManageUpdate method for detect collision or for anything else, sprite isn't rotating...

circleBox = new CircleBox(x, y, resourcesManager.circleBoxRegion, 2, vbom);

There is rotate function CircleBox class and is rotating in code above.When I use code below is not rotating why?

circleBox = new CircleBox(x, y, resourcesManager.circleBoxRegion, 2, vbom){
                    @Override
                    protected void onManagedUpdate(float pSecondsElapsed)
                    {
                        if(player.collidesWith(this)){
                            player.setCurrentTileIndex(8); // olunce duran adam pozistonuna gelsin
                            player.getBody().setTransform(new Vector2(100/PhysicsConstants.PIXEL_TO_METER_RATIO_DEFAULT, 
                                                                       400/PhysicsConstants.PIXEL_TO_METER_RATIO_DEFAULT), 0); //1=32

                        }

                    }
                };
1
Why did you add the cocos2d-iphone and iOS tags? They have no relevance here.LearnCocos2D

1 Answers

2
votes

I think you should call - super.onManagedUpdate(pSecondsElapsed) in onManagedUpdate() method.