chore: tidy
This commit is contained in:
parent
f68f8d359e
commit
6957365723
|
@ -39,7 +39,6 @@ export default class Script {
|
|||
|
||||
static contextDefaults() {
|
||||
return {
|
||||
Array,
|
||||
console,
|
||||
delta,
|
||||
lfo,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue
Block a user