14 lines
295 B
JavaScript
14 lines
295 B
JavaScript
import {System} from '@/ecs/index.js';
|
|
|
|
export default class Water extends System {
|
|
|
|
tick(elapsed) {
|
|
const {Water} = this.ecs.get(1);
|
|
for (const tile in Water.water) {
|
|
Water.water[tile] = Math.max(0, Water.water[tile] - elapsed);
|
|
}
|
|
Water.water = {...Water.water};
|
|
}
|
|
|
|
}
|