Jump to content

Scale tilemap and follow sprite [camera issue]


z0nics
 Share

Recommended Posts

Hi guys!

I'm doing a 2D game with tiled map and I've run into a problem.

When the group of objects (map layer and unit sprites) scaled, and camera is focused on sprite (by following with lerp), camera.view, or autoCull (or something else) gets some offset lag :(

But all works fine with image map. You can uncomment the /* image map */ section in 'create' tab to check it out. Dont forget to comment the /*  tile map */ section ;)

Just look: http://phaser.io/sandbox/edit/XNQoDGUq

Buttons:

LEFT ARROW - center camera on unit1 and scale group to 1.2 (if not zoomed);

RIGHT ARROW - center camera on unit2 and scale group to 1.2 (if not zoomed);

UP ARROW - unzoom (set group scale to 1);

 

Spent last two days to fix this out, but have no more ideas.

Link to comment
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...
 Share

  • Recently Browsing   0 members

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