How to test love2d project without creating .love each time

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
mustafatouny
Prole
Posts: 5
Joined: Wed Jun 21, 2017 1:45 pm

How to test love2d project without creating .love each time

Post 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
MrFariator
Party member
Posts: 510
Joined: Wed Oct 05, 2016 11:53 am

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

Post 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).
User avatar
xNick1
Party member
Posts: 267
Joined: Wed Jun 15, 2016 8:27 am
Location: Rome, Italy

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

Post 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).
User avatar
erasio
Party member
Posts: 118
Joined: Wed Mar 15, 2017 8:52 am
Location: Germany

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

Post 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 :)
User avatar
Stifu
Party member
Posts: 106
Joined: Mon Mar 14, 2016 9:53 am
Contact:

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

Post 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.
Zabuyaki, our upcoming beat 'em up: https://www.zabuyaki.com
User avatar
zorg
Party member
Posts: 3441
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

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

Post 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.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
slime
Solid Snayke
Posts: 3132
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

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

Post 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.
mustafatouny
Prole
Posts: 5
Joined: Wed Jun 21, 2017 1:45 pm

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

Post by mustafatouny »

Thank you all for your support, That was really helpful but I figured out a simpler solution using Atom text editor
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 27 guests