I originally started using this.cameras.main.roundPixels = true
to fix an issue with random lines appearing between tiles from my tile map. I have posted an image below of what I am talking about.
I have also added pixelArt = true
in my phaser config, and this seemed to reduce the lines a lot but they can still be found.
setting this.cameras.main.roundPixels = true
fixes all issues with “random lines”. however now sprite seems to jitter a lot on movement.
No Jitter
Jitter
Phaser config
const phaserConfig = {
type: Phaser.AUTO,
parent: "game",
physics: {
default: 'arcade',
arcade: {
gravity: { y: 300 },
debug: false,
},
},
pixelArt: true, // I think I need this
width: window.innerWidth ,
height: window.innerHeight,
backgroundColor: "#5DACD8",
scene: [MainMenu, myScene]
};
Camera call from scene-one.js
this.cameras.main.startFollow(this.playerMap[id])
this.cameras.main.roundPixels = true;
I have also tried these settings as well in my scene-one.js
this.physics.world.setFPS(60);
this.cameras.main.zoom = 1;
Here is the code for player movement with tween
var tween = this.tweens.add({
x:x,
y:y,
targets: player,
duration: duration,
ease: 'Linear',
yoyo: false,
repeat: 0,
});
Any ideas on how to get the best of both worlds , eliminate the random lines but also have no jitter on my sprite movement?