How to Setup Love2D with Visual Studio Code

Zeeshan Ali
2 min readJan 15, 2021

--

Getting your setup ready for executing Lua code for Love2D game engine through Visual Studio Code editor

  1. Go to https://love2d.org/ and install Love2D for the operating system specific to your laptop or computer. For me it was Windows 64-bit installer.
love2d.org installation

2. Make sure you take a note of where the love.exe is being installed

love.exe file path

When you click on love.exe you will see below image. That means love is installed properly, we see this image because we are not running any program right now.

Love2D installed

3. In Visual Studio Code install, go to extensions (see 1 in the image) . Install Love2D Support extension. Go to the settings of Love2D Support extension (see 2 in the image) .

Love2D Support Extension

4. Select the settings and go to extension settings.

Go to extension settings

Make sure the path is correct. That means it matches the path where love.exe is present.

Confirm path is correct for love.exe

5. Create a new folder for our project. Create an empty file main.lua in it and write the below code to display text on the love console.

Lua.main Hello World

Press Alt+L to run the program. You should see the text that you entered displayed in love console. That means the setup is successful, you can code your games in lua for Love2D in VS Code editor.

Displaying Hello World in Love2D console

This is it. Have fun building your games in Love2D.

--

--

Zeeshan Ali
Zeeshan Ali

Responses (2)