diff --git a/app/util/script.js b/app/util/script.js index fb063af..6ed3627 100644 --- a/app/util/script.js +++ b/app/util/script.js @@ -39,7 +39,6 @@ export default class Script { static contextDefaults() { return { - Array, console, delta, lfo, diff --git a/public/assets/tomato-seeds/projection-check.js b/public/assets/tomato-seeds/projection-check.js index 09311de..aa0f8b2 100644 --- a/public/assets/tomato-seeds/projection-check.js +++ b/public/assets/tomato-seeds/projection-check.js @@ -1,16 +1,17 @@ const layer = ecs.get(1).TileLayers.layer(1) +const {tileSize} = layer; const filtered = [] for (const position of projected) { - const x0 = position.x * layer.tileSize.x; - const y0 = position.y * layer.tileSize.y; - const entities = Array.from(ecs.system('Colliders').within({ + const x0 = position.x * tileSize.x; + const y0 = position.y * tileSize.y; + const entities = ecs.system('Colliders').within({ x0, - x1: x0 + layer.tileSize.x - 1, + x1: x0 + tileSize.x - 1, y0, - y1: y0 + layer.tileSize.y - 1, - })); + y1: y0 + tileSize.y - 1, + }); let hasPlant = false; for (const {Plant} of entities) { if (Plant) { @@ -25,4 +26,4 @@ for (const position of projected) { } } -return filtered +filtered diff --git a/public/assets/tomato-seeds/start.js b/public/assets/tomato-seeds/start.js index eaa3241..a275f3e 100644 --- a/public/assets/tomato-seeds/start.js +++ b/public/assets/tomato-seeds/start.js @@ -27,7 +27,7 @@ if (projected?.length > 0) { Plant: { growScript: '/assets/tomato-plant/grow.js', mayGrowScript: '/assets/tomato-plant/may-grow.js', - stages: Array(5).fill(0.5), + stages: [0.5, 0.5, 0.5, 0.5, 0.5], }, Sprite: { anchorY: 0.75,