Reputation: 21
I have made a new folder to keep my coding files in and folders of Love2D. But since then whenever I press alt+l in my main.lua file in vs code, the file doesn't run in love app.
But, when I try to drag and drop the folder of my game onto the love2D shortcut on my desktop, the game runs fine.
Why does this happen?
Here are the settings of my love2d support extension:
I have tried reinstalling love, also tried to reinstall the extension, and installing any previous version of love.
I tried to open the project directly as a project too.
Pls, can someone help me at the earliest?
Upvotes: 2
Views: 2170
Reputation: 1
I'm late to answering this but I hope it helps someone. It looks like you have Live Server extension installed, I believe that also has a key combo of ALT+L, which interferes with the Love2D extension.
Try removing Live Server, or change the key combo to something other than ALT+L for either of the extensions.
Upvotes: 0
Reputation: 1539
You provided .
as the src directory in the support extension, which probably tries to launch PIYUSH_LOVE2D
as the game (which does not contain a main.lua
).
Either open the game directory directly as a project in VS Code or enter the path of the game in Src Dir
.
EDIT: Alt+L while the main.lua
is open works and uses the dir containing the main as the root. The correct path is only required if the main.lua
is not open.
Upvotes: 1
Reputation: 28
I found something that can help you on the LÖVE 2D website. Take a look:
“Remember to drag the folder containing main.lua, and not main.lua itself”
I don't know much about VS Code but I think to solve your problem you could configure it to run the game folder in LOVE, instead of its main.
Upvotes: 0