Html Online games?

Is it possible to create a html online game like agar.io?

1 Like

Yes, you can build html5 games with Defold.

Take note that it is as easy to build html5 games as it is to build for any of the other platform in Defold.

1 Like

I know that you can make an Html game but can you make it connect to a server?

Yes, it is possible @britzl made a library for that called DefNet that should make it easier for you.

Any http.request or socket connection should work just as well on an HTML5 build as on mobile or desktop. Are you not able to get your HTML5 build to connect?

No, It dosen’t connect to the internet if I use a HTML5 build. (Im using NoobHub )

Have tested with DefNet but if you want to have 2 players play at the same time (on different computers) the host won’t send it’s position or something. It works only if both players are on the same computer. (also it would lag if 3+ players played at the same time and it was only local multiplayer (same network)) So I switched to NoobHub and it won’t connect to the internet on a HTML5 build.

Ah, I see. I was lying just a little when I wrote:

Socket connections aren’t ordinary sockets, since there’s no way to create a TCP or UDP connection from javascript. Emscripten (which we use to transpile the engine into Javascript) will automatically convert C socket connections to websockets, and if NoobHub doesn’t support websockets then you’re out of luck. You should submit a feature request to the creator of NoobHub.

1 Like