Basic entity system
This commit is contained in:
+4
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user