Initial commit

This commit is contained in:
2026-02-24 15:36:10 -03:00
commit fe885a9e24
42 changed files with 2383 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
import { System, World } from "$/common/ecs/mod.ts";
import { Position } from "$/common/components/position.ts";
import { Velocity } from "$/common/components/velocity.ts";
export class MovementSystem extends System {
update(world: World, delta: number): void {
for (const entity of world.get_entities()) {
const position = entity.get(Position);
const velocity = entity.get(Velocity);
if (position && velocity) {
position.x += velocity.vx * delta;
position.y += velocity.vy * delta;
position.x = Math.round(position.x);
position.y = Math.round(position.y);
}
}
}
}