enriqueto Posted April 21, 2015 Share Posted April 21, 2015 Hi, I'm producing a map scene with lots of items and particles. The map needs scrolling. What would be better in terms of performance. To tween the map container or move the camera? Thanks Link to comment Share on other sites More sharing options...
valueerror Posted April 22, 2015 Share Posted April 22, 2015 moving the camera should be the easy choice. otherwise you have to move every little object Link to comment Share on other sites More sharing options...
enriqueto Posted April 22, 2015 Author Share Posted April 22, 2015 moving the camera should be the easy choice. otherwise you have to move every little object no, all objects that compose the map are inside a Phaser.Group Link to comment Share on other sites More sharing options...
valueerror Posted April 22, 2015 Share Posted April 22, 2015 well if they are in one group its at least "do-able" but what about physics if you move the objects manually.. don't they move on their own? what will happen with collisions if you set the x and y coordinates directly - circumventing the physics system? just some thoughts... performance wise i have the impression that there is no noticeable difference between moving the camera and moving the map (i do both in two different games) Link to comment Share on other sites More sharing options...
drhayes Posted April 22, 2015 Share Posted April 22, 2015 The built-in Camera class does this by moving the world for you. Since "game.world" is subclassed from Group and everything gets added to it this has the effect of moving everything. I'd use the camera class and tween its view rectangle, myself. valueerror 1 Link to comment Share on other sites More sharing options...
enriqueto Posted April 25, 2015 Author Share Posted April 25, 2015 ok, I'll try tweening the camera Link to comment Share on other sites More sharing options...
Recommended Posts