🚀 use ts node

This commit is contained in:
platane
2020-10-16 18:54:09 +02:00
parent 5243a665b1
commit 89e2630eec
8 changed files with 32 additions and 17 deletions

View File

@@ -44,7 +44,7 @@ export const drawSnakeLerp = (
const m = 0.8;
const n = snake0.length / 2;
for (let i = 0; i < n; i++) {
const u = (i + 1) * 0.6;
const u = (i + 1) * 0.6 * (o.sizeCell / 16);
const a = (1 - m) * (i / Math.max(n - 1, 1));
const ki = clamp((k - a) / m, 0, 1);

View File

@@ -85,3 +85,10 @@ export const drawLerpWorld = (
ctx.restore();
};
export const getCanvasWorldSize = (grid: Grid, o: { sizeCell: number }) => {
const width = o.sizeCell * (grid.width + 2);
const height = o.sizeCell * (grid.height + 4) + 30;
return { width, height };
};