refactor: edge cam logic commented for now
This commit is contained in:
parent
4397011b25
commit
9f33e4df8a
|
@ -1,5 +1,8 @@
|
||||||
|
// import {RESOLUTION} from '@/constants.js'
|
||||||
import {System} from '@/ecs/index.js';
|
import {System} from '@/ecs/index.js';
|
||||||
|
|
||||||
|
// const [hx, hy] = [RESOLUTION.x / 2, RESOLUTION.y / 2];
|
||||||
|
|
||||||
export default class FollowCamera extends System {
|
export default class FollowCamera extends System {
|
||||||
|
|
||||||
static queries() {
|
static queries() {
|
||||||
|
@ -24,6 +27,11 @@ export default class FollowCamera extends System {
|
||||||
updateCamera(portion, entity) {
|
updateCamera(portion, entity) {
|
||||||
const {Camera, Position} = entity;
|
const {Camera, Position} = entity;
|
||||||
if (Camera && Position) {
|
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] = [
|
const [px, py] = [
|
||||||
Math.round(Position.x),
|
Math.round(Position.x),
|
||||||
Math.round(Position.y),
|
Math.round(Position.y),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user