Basic entity system

This commit is contained in:
2026-09-28 15:12:06 -03:00
parent 84a622c3f1
commit 52ef4e5ca6
17 changed files with 3330 additions and 246 deletions
+4 -1
View File
@@ -3,6 +3,7 @@ import type { BlockHitResult } from "./level/client_level.ts";
import { LocalPlayer } from "./entity/local_player.ts";
import { RemotePlayer } from "./entity/remote_player.ts";
import { ItemEntity } from "./entity/item_entity.ts";
import { RemoteEntity } from "./entity/remote_entity.ts";
import { Camera } from "./camera.ts";
import { Options } from "./options.ts";
import { MultiPlayerGameMode } from "./game_mode.ts";
@@ -69,7 +70,9 @@ export class Client {
this.level.add_entity(new RemotePlayer(this.level, info));
}
for (const info of connection.initial_entities) {
this.level.add_entity(new ItemEntity(this.level, info));
this.level.add_entity(
info.kind === "item" ? new ItemEntity(this.level, info) : new RemoteEntity(this.level, info),
);
}
this.game_mode = new MultiPlayerGameMode(this);