Page 1 of 1

How to test love2d project without creating .love each time

Posted: Wed Jun 21, 2017 1:57 pm
by mustafatouny
Hello,
It's necessary to test the project during coding, Saving .lua file with the text editor them compress .zip then changing to .love each time is severe, Is there a way to do that effectively like unity engine? Keep in mind that I am using Mac OS.
Thank you

Re: How to test love2d project without creating .love each time

Posted: Wed Jun 21, 2017 11:05 pm
by MrFariator
If you have love installed on your system (so that it's added to your system's PATH), you can open the command line prompt in the folder where your main.lua is situated and run the command:

Code: Select all

love .
I have personally setup my installation of Sublime Text 2 to run my project using its build system just by pressing F5, and plenty other code editors have the same capability (eq. Notepad++). I only zip my project and turn it into a .love file whenever I want to share my current build with a friend (and even for that I wrote a batch file to do it with just a double click).

Re: How to test love2d project without creating .love each time

Posted: Thu Jun 22, 2017 9:52 am
by xNick1
MrFariator wrote: Wed Jun 21, 2017 11:05 pm If you have love installed on your system (so that it's added to your system's PATH), you can open the command line prompt in the folder where your main.lua is situated and run the command:

Code: Select all

love .
I have personally setup my installation of Sublime Text 2 to run my project using its build system just by pressing F5, and plenty other code editors have the same capability (eq. Notepad++). I only zip my project and turn it into a .love file whenever I want to share my current build with a friend (and even for that I wrote a batch file to do it with just a double click).
As he says.
Otherwise, even on Linux I use an extension of Visual Studio Code called Love Launcher (There's something similar in Atom and ZeroBrane as well), to launch games with a shortcut. (Ctrl + L in my case).

Re: How to test love2d project without creating .love each time

Posted: Fri Jun 23, 2017 6:38 am
by erasio
Just to have this mentioned as well. You can also just execute love with a folder.

.love is just a .zip archive. But the framework itself doesn't actually care if the game is compressed or not.

So on windows dragging a folder onto love.exe will work just fine (you can also create a shortcut for that).

On linux you should be able to simply use your command line "love <yourGameFolder>".

That said. I also use the project and build system of sublime. CTRL + B is the magic shortcut in my case :)

Re: How to test love2d project without creating .love each time

Posted: Wed Jun 28, 2017 11:23 am
by Stifu
On Windows, I just created a little cmd / bat file on my desktop with this content:

Code: Select all

d:
cd "D:\Zabuyaki"
start "" "C:\Program Files\LOVE\love.exe" .
Hope that helps.

Re: How to test love2d project without creating .love each time

Posted: Wed Jun 28, 2017 11:53 am
by zorg
Stifu's code needs a short explanation; the d: in the first line switches to the d: (logical) drive, then the next line changes the working directory to where their game is, and finally uses the start command to run their game project... which is a bit unnecessary, but who am i to judge? :3

On windows, the following also work in cmd/bat (text) files, depending on where you put these:

Code: Select all

-- If the file is in your project folder:
"Path to your preferred love.exe" .\
-- Example: "e:\Portable Programs\love-0.11.0-win32\love.exe" .\

-- If the file is in the löve folder:
love "Path to your löve project folder where the main.lua file is in"
-- Example: love.exe "d:\code\love\mygame\"
You don't need to use " " symbols around the paths, only if there's spaces in folder names; that said, it doesn't hurt to use them always.

You can also add further command line parameters after the initial two, but be aware that starting up projects like this will affect the command line arguments passed to the game AND the love.filesystem.getWorkingDirectory function as well.

On the other hand, yes, i have read the OP, and they did ask for a solution on OS X; still, hopefully someone will provide one since i don't own any apple devices.

Re: How to test love2d project without creating .love each time

Posted: Wed Jun 28, 2017 11:48 pm
by slime
On macOS you can also rename your folder to have a .love extension and then just double-click it to launch it with love. You'll have to right-click and select 'Show Package Contents' to view the contents of the folder though.

Re: How to test love2d project without creating .love each time

Posted: Mon Jul 17, 2017 6:50 am
by mustafatouny
Thank you all for your support, That was really helpful but I figured out a simpler solution using Atom text editor