silphius/public/assets/tomato-plant/grow.js

16 lines
275 B
JavaScript
Raw Normal View History

2024-07-01 18:12:53 -05:00
const {Interactive, Sprite} = ecs.get(plant.entity);
plant.growth = 0
2024-06-27 15:08:30 -05:00
if (plant.stage < 3) {
plant.stage += 1
}
if (4 === plant.stage) {
plant.stage = 3
}
2024-07-01 18:12:53 -05:00
if (3 === plant.stage) {
Interactive.interacting = true;
2024-06-27 15:08:30 -05:00
}
Sprite.animation = ['stage', plant.stage].join('/')