The compatibility mode runs on nearly all browsers but has poor audio support right now.gianmichele wrote: ↑Mon Dec 21, 2020 11:24 pm I was playing some sheepolution games and all need chrome to run. Any reason for this? Will this ever run on mobile Safari?
Love.js - A Direct Emscripten Port
Re: Love.js - A Direct Emscripten Port
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
personal page and a raycaster
Re: Love.js - A Direct Emscripten Port
Maybe Safari needs that security header thingy like Firefox does? Or does it only work in compatibility mode?
Zabuyaki, our upcoming beat 'em up: https://www.zabuyaki.com
-
- Citizen
- Posts: 67
- Joined: Tue Jan 14, 2014 11:03 pm
Re: Love.js - A Direct Emscripten Port
Is this the year where finally love.js will become official?
Re: Love.js - A Direct Emscripten Port
If I get a general research grant for the summer I can spend that time working on whatever I wantgianmichele wrote: ↑Wed Jan 20, 2021 6:49 pm Is this the year where finally love.js will become official?
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
personal page and a raycaster
Re: Love.js - A Direct Emscripten Port
Yes, that would be awesome!
Re: Love.js - A Direct Emscripten Port
Hey, I decided to work a little bit on the love.js frontend. I think the way love.js game are built (using node.js) is way out of reach for most love2d users. Why can't we just use URL parameters like so:
https://2dengine.com/lovejs/?c=0&m=250000000 <- live demo
?c=1 or ?c=0 sets the compatibility mode (the player starts out in release mode and automatically fallbacks to compatibility mode if an error occurs - the compatibility mode works on mobile browsers so it's an important fallback IMO)
?m=250000000 sets the amount of memory
?r=1 disables the cache
Everything works fine, but I need help with a couple of things. loadPackage in game.js has the .love filesize hardcoded in there. Is the file size necessary just because of the loader? Can't we determine this size during the xmlrpc request? Any other tips on making this work as a standalone player so it can be embedded on websites? I think it would be super cool if it can switch games as a URL parameter. I would have just one of these players on my website and it could showcase all of my game demos (this would be an enormous advantage, especially if games/demos can be embedded on external websites).
Attached is what I have so far, without the "game.data" file. With a little bit of help I think we can make this a part of the love.js repo.
https://2dengine.com/lovejs/?c=0&m=250000000 <- live demo
?c=1 or ?c=0 sets the compatibility mode (the player starts out in release mode and automatically fallbacks to compatibility mode if an error occurs - the compatibility mode works on mobile browsers so it's an important fallback IMO)
?m=250000000 sets the amount of memory
?r=1 disables the cache
Everything works fine, but I need help with a couple of things. loadPackage in game.js has the .love filesize hardcoded in there. Is the file size necessary just because of the loader? Can't we determine this size during the xmlrpc request? Any other tips on making this work as a standalone player so it can be embedded on websites? I think it would be super cool if it can switch games as a URL parameter. I would have just one of these players on my website and it could showcase all of my game demos (this would be an enormous advantage, especially if games/demos can be embedded on external websites).
Attached is what I have so far, without the "game.data" file. With a little bit of help I think we can make this a part of the love.js repo.
- Attachments
-
- lovejsplayer.zip
- (3.16 MiB) Downloaded 1804 times
-
- Citizen
- Posts: 67
- Joined: Tue Jan 14, 2014 11:03 pm
Re: Love.js - A Direct Emscripten Port
WOW! Thanks ivan, was just looking for this. The beauty of love is that I just need the engine and a text editor, no bloat around. With love.js following the same path I would be a really happy coder
Re: Love.js - A Direct Emscripten Port
We should be thanking Davidobot, because he has put in most of the work behind love.js and knows its inner workings. Let's hope he can help us out in making a standalone love.js player. That would bring in more devs onboard.
Re: Love.js - A Direct Emscripten Port
Hi ivan!
Thanks for your work on this! I didn't really consider node.js out-of-reach, but this definitely simplifies things for the better. In my opinion, an ideal way of presenting this would look something like this:
- have an official hosted web player on the love2d.org domain. Maybe have some forum link-in that can automatically run .love files uploaded here? This wouldn't require too much web space and as it is a static page and most processing would happen on the client-side. Perhaps an updated and official version of https://schellingb.github.io/LoveWebBuilder/run-project
- have a small .exe/app file distributed with love whereby one can just drop a .love file or folder onto the application and it will package it and run a webserver to test the game.
We definitely can have something like this! This looks super. Especially the fallback mode - we should definitely get that into the main repo. It solves this issue: https://github.com/Davidobot/love.js/issues/5ivan wrote: ↑Mon Feb 01, 2021 8:23 pm Why can't we just use URL parameters like so:
https://2dengine.com/lovejs/?c=0&m=250000000 <- live demo
?c=1 or ?c=0 sets the compatibility mode (the player starts out in release mode and automatically fallbacks to compatibility mode if an error occurs - the compatibility mode works on mobile browsers so it's an important fallback IMO)
?m=250000000 sets the amount of memory
?r=1 disables the cache
I think the filesize is there exclusively for displaying the loading progress bar. You can easily check a file's size when handling upload via JS: relevant SO.
I think if we go down the LoveWebBuilder route, one can just provide a URL to a hosted .love file as a parameter to the webplayer and it should be able to compile it down and run it. This would make running things from this forum a lot more accessibleivan wrote: ↑Mon Feb 01, 2021 8:23 pm Any other tips on making this work as a standalone player so it can be embedded on websites? I think it would be super cool if it can switch games as a URL parameter. I would have just one of these players on my website and it could showcase all of my game demos (this would be an enormous advantage, especially if games/demos can be embedded on external websites).
Thanks again for your work. Please submit a pull request on GitHub!
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
personal page and a raycaster
Re: Love.js - A Direct Emscripten Port
Yes, looks cool.Davidobot wrote: ↑Tue Feb 02, 2021 1:28 pm - have an official hosted web player on the love2d.org domain. Maybe have some forum link-in that can automatically run .love files uploaded here? This wouldn't require too much web space and as it is a static page and most processing would happen on the client-side. Perhaps an updated and official version of https://schellingb.github.io/LoveWebBuilder/run-project
This is a cool idea, but not essential. Most people will expect to drop their .love file and assume that it works.
You are right, a better way would be to check the "user agent" string to determine if the browser supports release mode.Davidobot wrote: ↑Tue Feb 02, 2021 1:28 pm We definitely can have something like this! This looks super. Especially the fallback mode - we should definitely get that into the main repo. It solves this issue: https://github.com/Davidobot/love.js/issues/5
Line 40 in game.js is "xhr.onprogress" which finds the file size automatically, so we don't need to hardcode this.Davidobot wrote: ↑Tue Feb 02, 2021 1:28 pm I think the filesize is there exclusively for displaying the loading progress bar. You can easily check a file's size when handling upload via JS: relevant SO.
The .love file needs to be hosted on the same domain - otherwise there could be security issues.
I will look into but but I could use some help in figuring out how to change the hardcoded .love file.
Thanks!
Who is online
Users browsing this forum: No registered users and 2 guests