Skip to content

Commit

Permalink
feat: PhysicWorker
Browse files Browse the repository at this point in the history
  • Loading branch information
RSamaium committed Apr 12, 2024
1 parent f943c80 commit 7b423f4
Show file tree
Hide file tree
Showing 17 changed files with 1,078 additions and 1,835 deletions.
4 changes: 2 additions & 2 deletions packages/client/src/GameEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ export class GameEngineClient extends RpgCommonGame {
animationX: any;
animationY: any;

async initialize() {
initialize() {
super.initialize(GameSide.Client, Worker);
}

updateObject(obj) {
async updateObject(obj) {
const { playerId: id, params, localEvent, paramsChanged, isShape } = obj;
const findObject = this.objects().find((o: any) => o.id == id);
if (!findObject) {
Expand Down
3 changes: 3 additions & 0 deletions packages/client/src/RpgClientEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ export class RpgClientEngine {
this.gameEngine.playerId.set(playerEvent.playerId);
this.gameEngine.session.set(playerEvent.session);
});


await this.gameEngine.createWorker()

World.listen(this.socket).value.subscribe(
async (val: {
Expand Down
Loading

0 comments on commit 7b423f4

Please sign in to comment.