Jump to content

Sprite flickering


jevisan
 Share

Recommended Posts

Im having an issue with my game. The player sprite flickers when positioning at certain points in the game. My tile maps are made in tiled editor so no risk of misplacing a tile.

The flickering is only vertical and the physical body of the sprite is set a little smaller than the actual sprite which is 32 x 32 while the physical body is 16 x 28. I've also noticed that the flickering varies with the setting of the velocity. As an example, when jumping above a certain platform the sprite flickers when the assigned negative velocity of y and y gravity are assigned certain value, but it doesn't flicker when assigned another value.

On the other hand, on another part of the game the whole screen/camera flickers at certain height.

Any thoughts?

Link to comment
Share on other sites

thanks for your response, i've already tried setting Phaser.CANVAS without success. And setting sprite.body.maxVelocity.x does not reduce the flickering, i also tried setting the maxVelocity.y parameter but the flicker remains the same.

What i find funny is how tweaking the y velocity and gravity parameters affect the flickering.

If you have any other suggestion, it would be really appreciated.

edit: would it be because of the x and y positioning of the sprite?

Link to comment
Share on other sites

my guess:

Try to see if you have your platform set to sprite.body.moves = true when it actually is not moving, or immovable or anything that makes it not moving.

Or if you have a manual Y replacement of the player 1 or 2 pixel too much,

Or try to set player.body.velocity.y to 0 when colliding platform.body.top.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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