Jump to content

Help! I'm having a problem with camera.follow and a tiled background not updating


dajomu
 Share

Recommended Posts

Hi, 
I'm posting this because I've been doing a lot of searching and I can't seem to find a solution to this problem. I'm sorry if this is something generic that I've missed.

 

The problem:

When I start to move my player character, the character remains in the centre (good), but the tiled background doesn't scroll with the player. This means that the player can run and jump on platforms, but they are "invisible" as the background hasn't moved.

 

I'm using a Tiled generated level in a platformer.
The camera is following the player using -

this.camera.follow(player);

The level was created in tiled, it uses a 200 x 200 image split into a grid of 20x20 tiles.

The level itself is 64 x 40 tiles, so if the full resolution of the tiled level is 1280 x 800.

The resolution of the main phaser game is 640 x 400.

This means that the game should scroll in both x and y. I'm just doing this as a test so far and I may want to produce larger levels later.

 

Does anyone have any clues as to why this might be happening?

 

Thanks,

Dan

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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