14 lines
229 B
JavaScript
14 lines
229 B
JavaScript
|
const {Sprite} = ecs.get(plant.entity);
|
||
|
|
||
|
if (plant.stage < 3) {
|
||
|
plant.stage += 1
|
||
|
}
|
||
|
if (4 === plant.stage) {
|
||
|
plant.stage = 3
|
||
|
}
|
||
|
if (3 !== plant.stage) {
|
||
|
plant.growth = 0
|
||
|
}
|
||
|
|
||
|
Sprite.animation = ['stage', plant.stage].join('/')
|