Sign in to follow this  
jevisan

Sprite flickering

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?

Share this post


Link to post
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?

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

hi, thanks for your response. Well since the platforms are in a tilemap layer im not sure how to work with the body of the layer, been running test but with weird results. There's no manual set for the player.y value.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.