From 9f33e4df8a7c50a89eb5e904e43c8f390607f5f3 Mon Sep 17 00:00:00 2001 From: cha0s Date: Wed, 10 Jul 2024 16:54:04 -0500 Subject: [PATCH] refactor: edge cam logic commented for now --- app/ecs-systems/follow-camera.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/ecs-systems/follow-camera.js b/app/ecs-systems/follow-camera.js index 757fe64..11e0da6 100644 --- a/app/ecs-systems/follow-camera.js +++ b/app/ecs-systems/follow-camera.js @@ -1,5 +1,8 @@ +// import {RESOLUTION} from '@/constants.js' import {System} from '@/ecs/index.js'; +// const [hx, hy] = [RESOLUTION.x / 2, RESOLUTION.y / 2]; + export default class FollowCamera extends System { static queries() { @@ -24,6 +27,11 @@ export default class FollowCamera extends System { updateCamera(portion, entity) { const {Camera, Position} = entity; if (Camera && Position) { + // const {AreaSize: {x, y}} = this.ecs.get(1); + // const [px, py] = [ + // Math.max(hx, Math.min(Math.round(Position.x), x - hx)), + // Math.max(hy, Math.min(Math.round(Position.y), y - hy)), + // ]; const [px, py] = [ Math.round(Position.x), Math.round(Position.y),