Jump to content

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


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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...