1
\$\begingroup\$

I am new to game development. After observing some AndEngine code snippets, I am trying to figure out which camera would be best suitable for my 2D game. Either it's BoundCamera, SmoothCamera or ZoomCamera?

I just know that these three classes inherit Camera and bound Camera is used to limit camera area it can follow player.

Can someone tell what's the difference between these three cameras and when should I use one? It would be great if you can give some example. Thanks.

\$\endgroup\$
4
\$\begingroup\$

The camera hierarchy goes like this:

SmoothCamera extends -> ZoomCamera extends -> BoundCamera - Zoom cameras adopt Bound camera properties/methods. Smooth cameras adopt Zoom camera and Bound camera properties/methods

Choosing a SmoothCamera you'll have all the functionality from the others.

The difference between them is that they simply gain functionality depending on which you pick.

BoundCamera can be free moving, the position can be set manually by yourself or can be bound to a particular sprite or object to follow the x,y coordinates of that object constantly.

ZoomCamera is like BoundCamera, it can be freemoving, or follow an object but this time you can dynamically set the zoom level and make handlers to zoom in or out on the scene (You could add pinch to zoom functionality with this camera).

SmoothCamera can zoom, free-move, follow and additionally have a speed setting that allows it to tween from one position to the next. So when following an object it will move smoothly from point a to b, not snap to the object constantly. These parameters are generally set in the constructor.

I hope that makes it easier to understand.

\$\endgroup\$
  • \$\begingroup\$ No problem , you should up-vote too if you found it useful :) \$\endgroup\$ – Tom 'Blue' Piddock Jan 2 '14 at 10:46
  • 1
    \$\begingroup\$ done upvote! :) \$\endgroup\$ – NightFury Jan 2 '14 at 16:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.