Quantcast
Channel: Cocos Forums - Latest topics
Viewing all articles
Browse latest Browse all 17076

Camera or "Manual" scrolling - Effficiency

$
0
0

@Maxxx wrote:

I've always scrolled my sideways scroller by updating the Positions of all my entities based on their location in the 'World'
So if I have a static object (say a tree) and I am moving my player to the right, my Tree will have its X-Position reduced each frame

It all works very nicely, thank you very much!

However, I see that other game engines and more recently in cocos2d, use a camera to achieve the same effect - presumably changing the camera's location to the right as the player moves to the right.

This sounds like a good idea - but the camera is not well documented in cocos (or if it is, please point me to the documentation!) .

** I just found the camera documentation in the programmer's guide - missed it previously! This is really good documentation! Thanks @slackmoehrle

Also, it seems to me that the camera is a 3d entity, so will it be doing lots of maths to calculate the locations of all my entities ?

It looks to me as if my method should be far more efficient than using the camera ...

Has anyone done any comparisons? does the fact that the camera is just a front for openGL make it more efficient than I would think?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 17076

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>