phaser3-multiplayer-game-example icon indicating copy to clipboard operation
phaser3-multiplayer-game-example copied to clipboard

Use arcade-physics instead of @geckos.io/phaser-on-nodejs

Open yandeu opened this issue 3 years ago • 9 comments

We should replace @geckos.io/phaser-on-nodejs with arcade-physics.

yandeu avatar Dec 19 '22 14:12 yandeu

@yandeu. Hmm, I'm actually working on a game which uses Physics. Maybe I can update this. I do have a follow up question. Why aren't there any typescript examples using Geckos.io Also why is everything a Mono Repo? Would be great if the client and server were separated out.

Quitalizner avatar Dec 20 '22 14:12 Quitalizner

Is there a need for a typescript example?

Why not using a mono repo? It's easier to use.

yandeu avatar Dec 21 '22 14:12 yandeu

Some people are not very used to the concept of mono repo. And a typescript example would actually help, since there are C++ packages such as node_datachannel being used. Which cannot be bundled together, someone not very experienced might give up at this step when they try to compile.

To hit two birds with one stone, a separate repo for client and server built using typescript would help. I have it ready, you could just create the repos and I will make the PR

Quitalizner avatar Dec 21 '22 15:12 Quitalizner

Wait, we are talking about this (https://github.com/geckosio/geckos.io) repo, right?


If we are talking about the repo phaser3-multiplayer-game-example, for simplicity, I suggest the following:

  • Using socket.io instead of geckos.io
  • Using arcade-physics instead of @geckos.io/phaser-on-nodejs
  • Instead of re-writing it in TS we could simply use the @ts-check attribute.

yandeu avatar Dec 21 '22 16:12 yandeu

My apologies, my comment should have been on geckos.io I'm talking about geckos.io examples

Quitalizner avatar Dec 21 '22 16:12 Quitalizner

Ok

I will take the time this week to update THIS example and this (https://github.com/yandeu/phaser3-multiplayer-with-physics) as well.

But those are not really mono repos, since they contain only one app, unlike the geckos.io repo which contains 3 different npm packages. So I will keep both phaser example in one single repo.

yandeu avatar Dec 21 '22 17:12 yandeu

That'd be great. Thank you

Quitalizner avatar Dec 21 '22 17:12 Quitalizner

I just updated some thing and now the example works again.

The other repo: I decided to archive it.

But still, replacing @geckos.io/phaser-on-nodejs with arcade-physics is probably a good idea.

yandeu avatar Dec 21 '22 22:12 yandeu

Sure, thank you very much. It's hard to decouple arcade physics from phaser. I asked around in the forums. They suggested not to use phaser headless just to run physics on the server side. I'm working on a platformer which uses tilemaps. Even still they didn't recommend it. But this example is still great for learning and as a starting point for peer-to-peer mutliplayer

Quitalizner avatar Dec 24 '22 07:12 Quitalizner