Love2D and HTML5 games

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
Harrylechienfou
Prole
Posts: 30
Joined: Tue May 21, 2019 2:02 pm

Love2D and HTML5 games

Post 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 :awesome:
User avatar
ivan
Party member
Posts: 1915
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Re: Love2D and HTML5 games

Post by ivan »

Tanner and Davidobot's love.js
It's still not 100% stable but will hopefully become mainstream in the future.
User avatar
Harrylechienfou
Prole
Posts: 30
Joined: Tue May 21, 2019 2:02 pm

Re: Love2D and HTML5 games

Post 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 :)
User avatar
ivan
Party member
Posts: 1915
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Re: Love2D and HTML5 games

Post by ivan »

Harrylechienfou wrote: Sun Sep 27, 2020 9:35 pmHave you tried it ?
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.
grump
Party member
Posts: 947
Joined: Sat Jul 22, 2017 7:43 pm

Re: Love2D and HTML5 games

Post by grump »

ivan wrote: Mon Sep 28, 2020 6:46 am https://2dengine.com/superchains/
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
User avatar
Harrylechienfou
Prole
Posts: 30
Joined: Tue May 21, 2019 2:02 pm

Re: Love2D and HTML5 games

Post by Harrylechienfou »

Not working for me neither on Safari (iOS on iPad) :/
(Exception thrown, see JavaScript console)
User avatar
ivan
Party member
Posts: 1915
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Re: Love2D and HTML5 games

Post 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.
User avatar
Harrylechienfou
Prole
Posts: 30
Joined: Tue May 21, 2019 2:02 pm

Re: Love2D and HTML5 games

Post 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.
User avatar
Stifu
Party member
Posts: 106
Joined: Mon Mar 14, 2016 9:53 am
Contact:

Re: Love2D and HTML5 games

Post 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.
Zabuyaki, our upcoming beat 'em up: https://www.zabuyaki.com
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 4 guests