How to set position of a dynamic body in andengine?
I'm developing a game using Box2D. I have to move ball according to
accelerometer. I have created a body n connected ballsprite to it. I'm
moving body using setLinearVelocity(). once the ball reaches the
boundaries of screen,i want to stop the movement of ball at the edge of
the screen. How do i do this?
public void onAccelerationChanged(AccelerationData arg0) {
ballBody.setLinearVelocity(arg0.getX(), 0);
}
No comments:
Post a Comment