challacade / legend-of-lua

MIT License
351 stars 43 forks source link

Linux release #14

Open juryrigging opened 1 year ago

juryrigging commented 1 year ago

Apparently YT disappears my comments about packaging for linux when I respond to those who ask. I don't know what about my posts causes the issue, they never give me a warning or anything. But it is probably more useful long term to say something here rather than over there anyway.

To distribute a linux release, zip your game from inside the containing folder, so main.lua is at the top level of the archive. To put it another way, you want everything except the folder your project is saved in, because love2d doesn't read beyond the first level of the directory tree when looking for initial data. Give your archive a .love extension instead of .zip (e.g legend-of-lua.love). That should do for the most part, along with a note to this affect:

Requires love2d version [compatible version number]. The package should be available in most repositories simply as love, or can be downloaded as an AppImage from love2d.org.

There are other options you might want to explore later to make things more robust as love versions change, but the above doesn't require much extra effort and should get you up and running now.

For linux users there are a few options to run the game:

  1. in terminal, cd to the folder the game is in and type "love legend-of-lua.love"
  2. in file browser, create a link or copy of the binary ("which love" in terminal should give the binary location) where love games are being stored, then just drag and drop the game onto the link, much like other platforms. If using the AppImage, games can be dragged and dropped on that as well.
  3. if love is installed from the repos, the game can also be executed like any other program by double clicking. Haven't tested this with just the AppImage on a system, but given it's containerised I'd guess not.
  4. Download and unzip the source code, then implement either method 1 or 2, replacing legend-of-lua.love with the game's containing folder (legend-of-lua-main).

Hope this is helpful.

IzaltinoDSouza commented 1 year ago

I try on linux using wine is working, the Windows release on Linux.

Install wine (on Ubuntu : sudo apt install wine)

Find where wine was installed In my cause was on /home/MYNAME/.wine/drive_c

Inside of drive_c : Create folder where you will put the game and copy or move " .exe, dlls others" inside of it.

Terminal : wine c:/games/legend_of_lua/legend.exe

ghost commented 8 months ago

@IzaltinoDSouza, it's better to just use menulibre to create a wine.desktop with the command wine %U (or just wine if you use KDE).

I still encourage making a Linux version, even tho if only compiled once in a few versions like x.0 versions, because it makes less headache for Linux users and on the long run prevents wine from not working for some reason.

also, Love2d greatly helps to code once, compile to all platforms.

also, @juryrigging, the game should be compiled as an AppImage, not a .love

ghost commented 8 months ago

also, @juryrigging, just for the obvious: you can actually compile it by yourself, just rename the .exe to .zip and use the files inside to make an AppImage, or just straight up rename it to .love.