silphius/resources/tomato-plant/grow.js
2024-09-17 01:25:39 -05:00

16 lines
275 B
JavaScript

const {Interactive, Sprite} = ecs.get(plant.entity);
plant.growth = 0
if (plant.stage < 3) {
plant.stage += 1
}
if (4 === plant.stage) {
plant.stage = 3
}
if (3 === plant.stage) {
Interactive.interacting = true;
}
Sprite.animation = ['stage', plant.stage].join('/')