Yet another LoveJS Player

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
alexjgriffith
Prole
Posts: 30
Joined: Wed Jan 20, 2021 9:50 pm

Yet another LoveJS Player

Post by alexjgriffith »

I've been working on tools for interactive development in lovejs. Took a small detour this week to put together a little lovejs-player, with some of the extensions my development tools rely on (websockets, and interop with JS).

https://alexjgriffith.itch.io/lovejs-player

Like all other Emscripten ports of Love2D, this version relies on Lua5.1, rather than luajit. The core virtual machine used by luajit is written in assembly, meaning it can't be compiled to wasm to run in the web.

Feedback on the tool and extensions would be appreciated. Note that the API for the websockets and js library may change. Right now it's tied directly into love2ds event system, however rewriting them to be polled will make it easier to update LoveJS in the future.

Image
User avatar
dusoft
Party member
Posts: 654
Joined: Fri Nov 08, 2013 12:07 am
Location: Europe usually
Contact:

Re: Yet another LoveJS Player

Post by dusoft »

Nice and well documented!
SamR71
Prole
Posts: 3
Joined: Thu Mar 09, 2023 10:30 am

Re: Yet another LoveJS Player

Post by SamR71 »

Having trouble getting my .love working with the tool hosted on lovejs-player

Error:
Reading Uploaded .love file
index.html:325 File main.lua does not exist on disk.
index.html:325 Error: [love "boot.lua"]:330: Cannot load game at path '/home/web_user/love/game.love'.
index.html:325 Make sure a folder exists at the specified path.
index.html:325 stack traceback:
index.html:325 [love "boot.lua"]:352: in function <[love "boot.lua"]:348>
index.html:325 [C]: in function 'error'
index.html:325 [love "boot.lua"]:330: in function <[love "boot.lua"]:126>
index.html:325 [C]: ?
index.html:325 [love "boot.lua"]:1340074251: in function <[love "boot.lua"]:42>
index.html:325 [C]: in function 'xpcall'
index.html:325 [love "boot.lua"]:357: in function <[love "boot.lua"]:355>
index.html:325 [C]: in function 'xpcall'
User avatar
alexjgriffith
Prole
Posts: 30
Joined: Wed Jan 20, 2021 9:50 pm

Re: Yet another LoveJS Player

Post by alexjgriffith »

I've seen this error before with .love files that didn't have a main.lua in the top level. It could also happen if something in the .love file botched the b64 encoding.

Do you have a copy of the .love file you can share?
gianmichele
Citizen
Posts: 67
Joined: Tue Jan 14, 2014 11:03 pm

Re: Yet another LoveJS Player

Post by gianmichele »

I had the same issue. main.lua is definitely in the top level.
I'm using a mac with osx and I know it does like to hide some crappy stuff in the zip. Maybe that?
User avatar
alexjgriffith
Prole
Posts: 30
Joined: Wed Jan 20, 2021 9:50 pm

Re: Yet another LoveJS Player

Post by alexjgriffith »

Maybe? I tested it again on several games on linux and windows and I am not getting the main.lua is missing error.

If someone is running macos could they test using the following zip command to build their project and see if it still errors out?

The script just changes to whatever game-directory your project is in, finds all files, sorts them and zips them without any extra metadata. It saves the .love file one directory up to prevent you from accidentally recursively including it in your zip file.

Code: Select all

cd game-directory && find -type f | LC_ALL=C sort | env TZ=UTC zip -r -q -9 -X ../game.love -@
Alternatively, if any of your projects are available on a git host I can test the program with them.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests