englercj / phaser-tiled

A tilemap implementation for phaser focusing on large complex maps built with the Tiled Editor.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

setBoundsToWorld

Weedshaker opened this issue · comments

Hi,

first, big thanks for this, really improves the fps... but I have had some issues. Although, one I could resolve and I wanted to let you know through this:

// resize the world to the new size
// TODO: Seems dangerous to do this here, may break if user wants to manually set bounds
// and this reset it each time scale changes.
this.resizeWorld();

Tilelayer.prototype.resizeWorld = function () {
    this.game.world.setBounds(0, 0, this.widthInPixels, this.heightInPixels);
    this.game.physics.p2.setBoundsToWorld(true, true, false, true, false);
};

solves the issue that bounds get lost... maybe it could be nicer implemented though, but I needed a fast fix.

Cheers

This is fixed in v2, hopefully I can release it Soon.

I am having this same issue, except that the solution in 4a4b9a1 does not resolve it. I have spent a lot of time trying to figure it out with no luck.

Here's the code in question.
https://github.com/zpchavez/lvv/blob/develop/application/src/classes/states/track-loader.js

You can try it yourself here. Just drive immediately to the left and you'll go right off the map.

Hope you can help me out. Thanks.

Hey @zpchavez I haven't forgotten about you, just been super busy lately. Hopefully I can look into this sometime this weekend.

Thanks!