NxT Posted December 28, 2013 Share Posted December 28, 2013 First post here, been teaching myself Phaser very easily, it's a good framework. However, I'm having problems with having the camera follow a player sprite when using tilemaps. I've been following the 'Starstruck' example fairly closely with my own assets, and adding the game.camera.follow(player); line at the end of my create() function seems to be causing problems. The character sprite can move no more than approximately half of the way across the canvas before colliding with an 'invisible wall'. It seems the camera isn't moving with the player and restricting movement.Commenting out this line allows the character to move freely, but the camera doesn't follow. What did I miss? Pastebin Here. Link to comment Share on other sites More sharing options...
dchhetri Posted December 29, 2013 Share Posted December 29, 2013 Bumping this as I've been experiencing the same issue. Using the latest phaser. Im also using the camera.follow method and asserting that deadzone is set to null. Using sprite/camera and tile maps together, its causing issues for my sprite to not move to pass certain coordinate. I do not have any collision set up. If I comment out the camera.follow code and move the player around freely then there seems to be no problem, verifying this by manually moving the camera with w|s|a|d keys and moving character with the cursors. Link to comment Share on other sites More sharing options...
NxT Posted December 31, 2013 Author Share Posted December 31, 2013 Wow, not that hard actually. Add the line 'layer.fixedToCamera = false;' and all will be resolved. Link to comment Share on other sites More sharing options...
Recommended Posts