phaserjs / phaser

Phaser is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.
https://phaser.io
MIT License
36.94k stars 7.08k forks source link

Broken Example (player doesnt get physics collider) #4479

Closed KingCosmic closed 6 months ago

KingCosmic commented 5 years ago

Version

Description

The player in this example seems to not be getting it's collider (pressing C to show debug before it falls off screen) Broken Example

Additional Information

Found via yassin#3588 who asked about it in the discord, I was unable to find a reason it was happening through a quick glance and so made this issue.

schomatis commented 5 years ago

There seems to be an over-correction (at least for this example) in

https://github.com/photonstorm/phaser/blob/70b500cd2881dddd3a816a504c28ad1c692df96f/src/physics/arcade/World.js#L2168-L2173

It becomes visible when the TILE_BIAS is increased and the player is moved way over the tile during the collision (instead of passing though). Removing the if stabilizes it (although the real solution probably needs to refine it to apply it only to certain cases).

photonstorm commented 4 years ago

Had a quick look and the player collides happily with the 'ground' layer in the middle, just not the 'kenny' later on the left. Needs further investigation, but to do with varying tile sizes rather than anything else.

photonstorm commented 6 months ago

Thank you for submitting this issue (5 years ago!). We have fixed this and the fix has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.

👴🏻