Jump to content

Camera follow with tilemaps help


NxT
 Share

Recommended Posts

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

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

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...