silphius/app/ecs-systems/reset-forces.js

23 lines
354 B
JavaScript
Raw Normal View History

2024-06-25 10:44:37 -05:00
import {System} from '@/ecs/index.js';
export default class ResetForces extends System {
static get priority() {
2024-06-26 07:41:07 -05:00
return {phase: 'post'};
2024-06-25 10:44:37 -05:00
}
static queries() {
return {
default: ['Forces'],
};
}
tick() {
2024-06-26 07:41:07 -05:00
for (const {Forces} of this.select('default')) {
2024-06-25 10:44:37 -05:00
Forces.impulseX = 0;
Forces.impulseY = 0;
}
}
}