chore: tidy

This commit is contained in:
cha0s 2024-07-20 07:20:32 -05:00
parent f68f8d359e
commit 6957365723
3 changed files with 9 additions and 9 deletions

View File

@ -39,7 +39,6 @@ export default class Script {
static contextDefaults() {
return {
Array,
console,
delta,
lfo,

View File

@ -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

View File

@ -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,