-
Notifications
You must be signed in to change notification settings - Fork 4
Running Via Command Line
Make sure your Love2D application is in your /Applications/
folder and add the following line to your ~/.bash_profile
to use the love
command in the terminal:
(NOTE: you may have to create ~/.bash_profile
yourself, as it may not already exist. For more information, see https://love2d.org/wiki/Getting_Started
alias love="Applications/love.app/Contents/MacOS/love"
Then, run the following to start the game from the beginning (while terminal is in the directory of the main.lua file):
love .
Locate where you installed Love2D (love.exe
); it typically defaults to C:\Program Files\LOVE\
.
cd
into whichever directory contains the game files.
To run the game from the beginning:
[path to love.exe] .
If there is whitespace in your path, you must wrap it in quotation marks.
For example, if love.exe
is in the default directory, the command would be:
"C:\Program Files\LOVE\love.exe" .
From the start menu, search for environment variables
and select the option that says Edit the system environment variables
.
A small "System Properties" window will pop up. click on the button towards the bottom of the window that says Environment Variables...
. Another window will pop up
In the top box labeled User variables for [your username]
, highlight (by clicking on) the variable named Path
, then click the Edit...
button directly below the box.
Click the New
button and enter the path to Love2D directory you located earlier (C:\Program Files\LOVE\
by default). Press the Enter key then close all the small windows by clicking OK
.
Now, in Command Prompt, cd
into whichever directory contains the game files.
To run the game from the beginning:
love .
When running in the command line, there are optional arguments that you can pass in that may be useful for testing the game. Please note that even on Windows, when passing the path to the script file, you must still use forward slashes /
. It's also possible to pass in debug
as an argument to display the FPS indicator and cause the scroll speed of the text to be increased by a factor of 8. e.g. love . debug
For example, you can pass in a script file as an argument to test it out directly:
love. script "scripts/[scriptname].script"
You cab also run the following to skip a specific number of events:
love . skip [number of events to skip]
You can even combine both at the same time, like this:
love . script "scripts/e1s1.script" skip 50