1 decade ago by mimik
Trying to make a smooth camera in a topdown game.
Camera works fine as long as we have 60fps.
But if the game drops below we get a studdery camera.
Is there a way i missed to make it smooth or frame rate independent?
Camera code:
Also checked Dominics camera plugin but that doesn't work for top-down.
Camera works fine as long as we have 60fps.
But if the game drops below we get a studdery camera.
Is there a way i missed to make it smooth or frame rate independent?
Camera code:
this.camspeed = 4 // same result with any number. this.screen.x = this.screen.x - (this.screen.x - (this.player.pos.x - ig.system.width / 2)) * ig.system.tick * this.camspeed this.screen.y = this.screen.y - (this.screen.y - (this.player.pos.y - ig.system.height / 2)) * ig.system.tick * this.camspeed
Also checked Dominics camera plugin but that doesn't work for top-down.