Page 1 of 1
Love2D and HTML5 games
Posted: Sun Sep 27, 2020 4:23 pm
by Harrylechienfou
Hi everybody !
I'm in love with LOVE2D but I want to start making games for game jams and I thought the best way to provide an easy-to-test-and-play game is to create a HTML5 game that a player can play directly on Itch.io ! Of course my question is : how to do such a thing with Love2D framework ?
Do you guys know what's the best/simpliest solution to do so ? I've heard different tools are supposed to do that, but that's not clear which one is compatible with the last version of Love2D.
Any suggestiosns ?
Thanks
Re: Love2D and HTML5 games
Posted: Sun Sep 27, 2020 4:54 pm
by ivan
Tanner and Davidobot's love.js
It's still not 100% stable but will hopefully become mainstream in the future.
Re: Love2D and HTML5 games
Posted: Sun Sep 27, 2020 9:35 pm
by Harrylechienfou
Thanks ! It looks interesting !
Have you tried it ? Is it simple to create a HTML5 game out of an existing project ?
It seems very promising that’s for sure, I’ll try it out
Re: Love2D and HTML5 games
Posted: Mon Sep 28, 2020 6:46 am
by ivan
https://2dengine.com/superchains/
Harrylechienfou wrote: ↑Sun Sep 27, 2020 9:35 pmIs it simple to create a HTML5 game out of an existing project ?
Some adjustments are required in particular with shaders, audio and love.filesystem.
For building you love.js project you will need the node.js command line.
Re: Love2D and HTML5 games
Posted: Mon Sep 28, 2020 12:18 pm
by grump
That's not working for me in Firefox 81.0
Code: Select all
Uncaught ReferenceError: SharedArrayBuffer is not defined
Love https://2dengine.com/superchains/love.js:9
applicationLoad https://2dengine.com/superchains/:35
onload https://2dengine.com/superchains/:1
Re: Love2D and HTML5 games
Posted: Mon Sep 28, 2020 12:26 pm
by Harrylechienfou
Not working for me neither on Safari (iOS on iPad) :/
(Exception thrown, see JavaScript console)
Re: Love2D and HTML5 games
Posted: Mon Sep 28, 2020 4:20 pm
by ivan
not working for me in Firefox 81.0
Thanks for reporting this. I have rebuilt the games in compatibility mode and it now works with Firefox (although the audio is buggy). I guess it's a tradeoff between working perfectly in Chrome vs working without audio across browsers.
https://2dengine.com/arena/
It would be good if there was an automatic fallback between compatibility vs non-compatibility mode. JavaScript should be able to detect the user's browser anyways.
Not working for me neither on Safari (iOS on iPad)
Not sure if mobile browsers are supported at all. Probably not.
Like I said - love.js is unstable but I still recommend using it because we hope it will become an official port in the future.
Re: Love2D and HTML5 games
Posted: Mon Sep 28, 2020 7:57 pm
by Harrylechienfou
Well now your new version works also on iOS with Safari
I tried it and it launches correctly, there’s no error anymore.
I can’t play because I don’t have a gamepad or something like that but the game seems to work.
Re: Love2D and HTML5 games
Posted: Mon Sep 28, 2020 8:08 pm
by Stifu
ivan wrote: ↑Mon Sep 28, 2020 4:20 pm
not working for me in Firefox 81.0
Thanks for reporting this. I have rebuilt the games in compatibility mode and it now works with Firefox (although the audio is buggy). I guess it's a tradeoff between working perfectly in Chrome vs working without audio across browsers.
https://2dengine.com/arena/
Actually you can get it to work with Firefox even using the best (less compatible) mode. For example:
https://www.zabuyaki.com/play/
How to achieve this is explained in the readme.md of
the GitHub repo.