Page 1 of 1

Does love.js supports socket?

Posted: Fri Oct 14, 2016 7:16 am
by bonez001
I am trying to build a html5 game. I consider (and still considering) building it with phaser but I'm already familiar with love2d so there might be a a way for me. I only want to interface the game with a database using node.js since luasql is hard to implement in love2d. Or maybe I am really in the wrong direction?

Re: Does love.js supports socket?

Posted: Fri Oct 14, 2016 9:23 am
by Positive07
First let me tell you that writing in the Ports, or the Support and Development sections should be more appropiate. Also if you want people with knowledge to answer you should directly ask in the post about love.js

Anyway love.js does not support sockets and probably never will, it may implement it's own network library but not at the moment. The problem is there is no way for a webpage to access low level network features like UDP and TCP sockets, the only available network connections are either HTTP or Websockets, anyway this means that emscripten can't compile the sockets and ENET libraries in LÖVE so they are excluded from the love.js port

Note that this is not the only missing feature from love.js, check out the issue tracker to see what isn't there yet, stuff like threads, video, and even some audio stuff (OpenAL issues mostly) are missing so I can't recommend to use love.js in this early stage, since there are better frameworks to develop webgames (and they are not much harder than LÖVE)

Don't mistake me though, I think love.js is great and it can power projects that may benefit the LÖVE community like the recent Love Fiddle but I wouldn't use it for a release of a bigger project. Right tool for the job

Re: Does love.js supports socket?

Posted: Fri Oct 14, 2016 9:19 pm
by Tanner
Positive07 gives a good rundown on the state of love.js (thanks). I'd like to echo that, if you want to build a game that is exclusively for the web, use tools that are exclusively for the web. Otherwise you'll make your life harder and end up with a worse product.

Re: Does love.js supports socket?

Posted: Sat Oct 15, 2016 12:37 am
by Positive07
I'm glad I did good, I didn't want to disregard love.js nor the work that went on it since it's an amazing project.
Thank you for your work Tanner