Jump to content

Multiplayer example?


bbmario
 Share

Recommended Posts

Hi !

 

Take a look at : https://github.com/Jaskar/BabylonJS-Multiplayer-Exemple

I just upload it.

It works with nwjs & some modules (socket.io, path, express)

 

Steps :

Download NodeWebkit at http://nwjs.io/

Add modules socket.io, path, express (I let you search on the web how to do that)

Download my github repo

Add the package.json, serving and www folders to nwjs folder.

Click on nw.exe

Then, click on the button "open the server"

Ready to play ? Launch a browser and connect to 'localhost' (verify that wamp is not running). You can run as many browser as you want. Each time a new player will spawn. The only limitation is your graphic card.

 

WARNING : This code is just a stack of personnal test, and the code may be not commented or in french. So, you can take a look but at your own risk  :P

 

If you need some explanation, I'm sitting here  ;)

Link to comment
Share on other sites

  • 7 months later...

Sorry for Bumping an old thread,

I was playing around with your example, Jaskar, and upon trying to add a simple grass texture to the ground, it refuses to load it..

 

Instead of grabing it from the path i provided, "./../textures/grass.png"

 

it tries to GET/ it from http://127.0.0.1/textures/grass.png

and gives 404 error.

 

cheers.

 

EDIT(fix):

express.static wasn't set,

In case anyone else needs this,

navigate to \www\js\app_get.js and add:

 

app.use(express.static(dirName + '/serving'));

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...