mirror of
https://github.com/wassname/rl_2d_walker.js.git
synced 2026-09-09 11:33:20 +08:00
tweak camera
This commit is contained in:
+1
-1
@@ -34,7 +34,7 @@ class Renderer {
|
||||
this.target_zoom = Math.min(this.config.max_zoom_factor, this.getZoom(minmax.min_x, minmax.max_x + 4, minmax.min_y + 2, minmax.max_y + 2.5));
|
||||
this.zoom += 0.1 * (this.target_zoom - this.zoom);
|
||||
this.translate_x += 0.1 * ((1.5 - minmax.min_x) - this.translate_x);
|
||||
this.translate_y += 0.3 * ((minmax.max_y + 1.5) * this.zoom - this.translate_y);
|
||||
this.translate_y += 0.3 * ((minmax.max_y + 1.3) * this.zoom - this.translate_y);
|
||||
console.log(this.translate_y)
|
||||
this.ctx.translate(this.translate_x * this.zoom, this.translate_y);
|
||||
this.ctx.scale(this.zoom, -this.zoom);
|
||||
|
||||
Reference in New Issue
Block a user