I am a newbie to game development and currently using AndEngine for an android game. It is a right scrolling game where the player can continuously move to right of the screen like mario.
How can we have infinite right scrolling?
Currently, I am setting my boundCamera Limits like this:
camera.setBounds(0, 0, CAMERA_WIDTH*100, CAMERA_HEIGHT);
and I create a frame like this:
public void createFrame(){
// 205-175-149 cdaf95
final IAreaShape/*Shape*/ ground = new Rectangle(0, mCameraHeight - 2, mCameraWidth*100, 2, gameLogicController.getVertexBufferObjectManager());
ground.setColor(0.7f, 0.5f, 0.3f);
final IAreaShape/*Shape*/ roof = new Rectangle(0, 0, mCameraWidth*100, 2, gameLogicController.getVertexBufferObjectManager());
roof.setColor(0.7f, 0.5f, 0.3f);
final IAreaShape/*Shape*/ left = new Rectangle(0, 0, 2, mCameraHeight, gameLogicController.getVertexBufferObjectManager());
left.setColor(0.7f, 0.5f, 0.3f);
final IAreaShape/*Shape*/ right = new Rectangle(mCameraWidth*100 - 2, 0, 2, mCameraHeight, gameLogicController.getVertexBufferObjectManager());
right.setColor(0.7f, 0.5f, 0.3f);
final FixtureDef wallFixtureDef = PhysicsFactory.createFixtureDef(0, 0.5f, 0.5f);
PhysicsFactory.createBoxBody(this.mPhysicsWorld, ground, BodyType.StaticBody, wallFixtureDef);
PhysicsFactory.createBoxBody(this.mPhysicsWorld, roof, BodyType.StaticBody, wallFixtureDef);
PhysicsFactory.createBoxBody(this.mPhysicsWorld, left, BodyType.StaticBody, wallFixtureDef);
PhysicsFactory.createBoxBody(this.mPhysicsWorld, right, BodyType.StaticBody, wallFixtureDef);
scene.attachChild(ground);
scene.attachChild(roof);
scene.attachChild(left);
scene.attachChild(right);
}
But it ends up being fixed width only (100 times camera width). How can I have infinite width? If I give very large value, app crashes.
Thank you for any help..