Frage

I'm making a Lua game using the 2D framework 'LÖVE'.

I needed to know HOW to make a .exe file with it! I've done the command line, sucessfully zipped up my main.lua and the image, I've renamed the file extension to .exe!! When I run the .exe, I get a file extracting application coming up. This is not supposed to happen, right? I want it to be run as a game, not as a self-extracting application. Help?

War es hilfreich?

Lösung

From the sounds of it, you are trying to save your 'lovechive' with an .exe extension; your archiver is probably 'helpfully' assuming you meant to create a self extractor, which you didn't.


Okay, lets start by talking about how runable 'lovechives' work: When love.exe starts up, it first checks its own name, if its called something other than love or love.exe it immediately checks to see if there is somethng stuck to its end. if there is, then it tries to interpret it as if it were a 'lovechive'.

So basically, we want to stick a zip-file to love's bottom (don't worry, it likes it).

  1. Start by creating an ordinary zip archive of you game directory.
    • Remember to check for anything you don't actually mean to ship; plenty of love games have gone out containing backup copies of the source code, test artwork, and peoples' shopping lists. Don't be a statistic.
  2. The filename is irrelevant for what were are doing here, so don't worry about the usual step of renaming it to a .love. just make sure that what you have is an plain-ol' ordinary zip.
  3. The next step depends on your host platform, but basically you now need to do the whole "stick it to love's bottom' part now, generally this is done from the command-line:
    • On windows, the command is:
      copy /b love.exe+YourGame.zip TheGame.exe
      Where love.exe is the name of the main 'love' executable YourGame.zip is the name of zip file containing your game, and TheGame.exe is what you want the final game executable to be named.
    • On Linux or OSX, the command is:
      cat love YourGame.zip > TheGame
      Where love is the name of the main 'love' executable, YourGame.zip is the name of zip file containing your game, and TheGame is what you want the final game executable to be named.

These substituting the relevant filenames should let you produce versions for Linux, and Windows (All I know about making 'merged' OSX Apps is that its more complicated.)


For the record, it is utterly trivial to extract files from the 'merged' game. Usually nothing more than changing the file extension, sometimes not even that. And no, zip encryption doesn't help here; it won't run because love can't read the archive. (quite sensibly, really.)

Finally, If you are distributing to the Love community, they generally prefer that you just give them the 'lovechive.'

Andere Tipps

From https://love2d.org/wiki/Game_Distribution :

Here's how to do it on Windows. In a console, type this:

copy /b love.exe+game.love game.exe

Then, all you have to do is zip game.exe and required DLLs, and distribute them. Yes; this does mean that the game will have a private copy of LÖVE, but there's nothing wrong with that. It also means that you will have to create one package for each platform you would like to support, or simply offer the .love alone for the other platforms.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top