xronn Posted March 10, 2014 Share Posted March 10, 2014 Hi, using phaser 1.1.3 is there a way I can make the camera jump to the next section of the map instead of panning it across when the player moves. For example if he reaches the edge of the visible screen when he takes one more step the camera jumps to him loading the next section of the map?Thanks! Link to comment Share on other sites More sharing options...
rich Posted March 11, 2014 Share Posted March 11, 2014 If the Camera is following a sprite, you'll need to unfollow the sprite. Reposition the camera and then re-follow again. Link to comment Share on other sites More sharing options...
xronn Posted March 11, 2014 Author Share Posted March 11, 2014 At the moment the camera is just static when the player reaches the world boarder I want to jump the camera over. So I could do like when the player collides with the world border, camera follow player then stop following the player? Link to comment Share on other sites More sharing options...
rich Posted March 11, 2014 Share Posted March 11, 2014 If it's static then you don't need to follow at all, just re-position it when you're ready. Link to comment Share on other sites More sharing options...
xronn Posted March 11, 2014 Author Share Posted March 11, 2014 Thanks for the reply Rich in 1.1.3 I see in the documentation - setPosition(X, Y); This the correct function? Link to comment Share on other sites More sharing options...
rich Posted March 11, 2014 Share Posted March 11, 2014 Try it and see Failing that just set the view x/y properties directly. Link to comment Share on other sites More sharing options...
rich Posted March 11, 2014 Share Posted March 11, 2014 Just to add - x/y coordinates MUST be within the world bounds. Link to comment Share on other sites More sharing options...
xronn Posted March 11, 2014 Author Share Posted March 11, 2014 The only problem is detecting when the player hits the edge of the camera like shown here - https://www.dropbox.com/s/xcoxv2jfhjsyos9/Screenshot%202014-03-11%2014.42.17.png Link to comment Share on other sites More sharing options...
Recommended Posts