Add basic planet collision

This commit is contained in:
asraelite 2018-03-03 14:02:20 +00:00
parent b02675f4fb
commit 09b3df649c
6 changed files with 42 additions and 11 deletions

View file

@ -102,10 +102,10 @@ class Perspective {
}
transformCanvas() {
let [bx, by, bw, bh] = this.bounds;
let tx = -this.x + bw / 2;
let ty = -this.y + bh / 2;
context.translate(tx, ty);
let [,,bw, bh] = this.bounds;
let tx = -this.x * this.zoom;
let ty = -this.y * this.zoom;
context.translate(tx + bw / 2, ty + bh / 2);
context.scale(this.zoom, this.zoom);
}
}