jevisan Posted February 16, 2018 Share Posted February 16, 2018 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 More sharing options...
vastron Posted February 16, 2018 Share Posted February 16, 2018 These two have worked for me. Try setting up a max velocity (sprite.body.maxVelocity.x = 300), if flickering persists try enabling the game in Phaser.CANVAS mode , not Phaser.AUTO. Link to comment Share on other sites More sharing options...
jevisan Posted February 16, 2018 Author Share Posted February 16, 2018 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 More sharing options...
Kosmoon Posted February 16, 2018 Share Posted February 16, 2018 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 More sharing options...
jevisan Posted February 17, 2018 Author Share Posted February 17, 2018 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. Link to comment Share on other sites More sharing options...
Recommended Posts