Noaml1 Posted June 1, 2014 Share Posted June 1, 2014 A friend and I are working on a platformer-fighting game using the Phaser framework and are wondering if there is anyway built in function to keep multiple sprites on the screen at the same time?We want it so that we can zoom in to the players if they are all next to each other but for the camera to zoom out if they separate (kinda like super smash bros melee). Link to comment Share on other sites More sharing options...
lewster32 Posted June 1, 2014 Share Posted June 1, 2014 Not directly via the Phaser camera at this stage - it only supports following one object at a time and even if you were clever and created a group which contained players, and made the camera follow the mid-point/centroid of the players, you'd still have the problem of zooming in and out (via scaling) which, as far as I can tell is not very usable at the moment, causing all kinds of problems with anything you've fixed to the camera viewport etc. If you're able to do it without the zooming, then the centroid method would work quite well in most cases. Essentially you'd use Phaser.Point.centroid to set the position an invisible sprite and track that with the camera. The camera would then automatically be positioned in the middle of all of the players. Link to comment Share on other sites More sharing options...
Noaml1 Posted June 1, 2014 Author Share Posted June 1, 2014 Ok, thanks.Looks like we'll be making our own class to handle this. Link to comment Share on other sites More sharing options...
Recommended Posts