This commit is contained in:
Matthieu Jolimaitre 2024-04-10 00:37:18 +02:00
parent a633cb7252
commit 6bf8f60a45
5 changed files with 15 additions and 63 deletions

View file

@ -1,12 +1,11 @@
#!/bin/env -S deno run --allow-net --allow-read
import { log_from, v2, wait } from "../common/utils.ts";
import { log_from, v2 } from "../common/utils.ts";
import { Engine } from "./engine.ts";
import { Session } from "./entities/player.ts";
import { sys_spawn_obstacle, sys_spawn_structure } from "./components/world.ts";
import { sys_spawn_structure } from "./components/world.ts";
import { Gateway } from "./network.ts";
import { sys_spawn_enemy } from "./entities/enemy.ts";
import { spiral } from "../common/utils.ts";
const log = log_from(import.meta);
async function main() {
@ -16,14 +15,6 @@ async function main() {
engine.run(await sys_spawn_structure("../data/structures/houses.txt", v2(2, 2)));
engine.run(sys_spawn_enemy(v2(1, 1)));
(async () => {
await wait(5_000);
for (const pos of spiral(v2(-8, -8))) {
await wait(500);
engine.run(sys_spawn_obstacle(pos, "@@"));
}
})();
const port = 9999;
const gateway = new Gateway(port);
log("Awaiting connection.");