Udemy

Programming Environment in Lua

A free video tutorial from Kyle Schaub
Software Engineer
Rating: 4.8 out of 5Instructor rating
2 courses
15,636 students
Programming Environment

Learn more from the full course

Master Lua Programming and Create Amazing Games with LÖVE!

Learn the basics of programming, then use that knowledge to create games with the beginner-friendly game engine: Love2D!

08:25:38 of on-demand video • Updated June 2023

Understand the basics of programming
How to use Lua
Utilize the core features of LÖVE
Find and use open-source software
Incorporate additional editors and tools
Create your own games!
English [Auto]
Love is a pretty simple program to work with. And the reason I say this is because there is no interface to deal with or an editor that takes time getting used to. In fact, a completely viable way of programming with love is to do all of your programming in any text editor. But if you want my opinion on what the best way to work with love is, it's to use Visual Studio code. VS Code is a lightweight text editor built with programmers in mind. There's all kinds of built in helpful tools that make programming a lot easier, and there's also tons of packages that you can install that provide additional features. In our case, we're going to be using a package catered to Love, 2D and Lua. Now keep in mind that this step is completely optional. You can use any text editor you want to write Lua code and love 2D games. I personally find vs code to currently be the best option for love development. So I'm going to go ahead and show you how to set it up. The installation process is very simple. You can search online for Visual Studio code or you can go directly to code.visualstudio.com and then you're going to install this program for your operating system. This will work fine even if you're on Mac. I'm going to demonstrate this on Windows. And let's run this. When you're installing, I'm going to go ahead and create a desktop icon as well and install. And it's done. So let's go ahead and open up Visual Studio code. This is what it should look like as soon as you start it up. How it works is you can open any file or folder in this program and it'll let you directly edit the file contents. So it'll let us write our code very easily. In order to run our code directly with love, though, it'll be helpful to have a certain extension installed. VS code allows us to install extensions which are two some extra tools that help with certain tasks. To install an extension. We're just going to go over here to this button. Click it, and then we're going to search for the extension that we want to install. If we just search for Love 2D, the first option should be Love 2D support and this is the one we want. I'm going to click install and you'll know it installed as soon as you see this uninstall button. What this extension does is it gives us some added support for Love 2D projects, but most of all, it lets us easily run Love 2D code directly from our editor. Before we close out of this, we do need to check some settings on this extension. So we'll go over here to this little gear icon and we're going to choose extension settings. There's a few things we can check on here, but the main thing that we want to look at is this Love 2D path. This is the path to love X. When you installed love, it installed to some directory on your computer. And this is the path that we looked at last time in order to create our shortcut. For me it is C Program Files. Love Lovex. And I encourage you to go to this path in a file explorer or something and verify that there is a lovex in this folder. If there isn't, then you'll need to reinstall love. So when you have this box accurate, we'll be testing this out actually in the next lecture. But first we'll need some sample code to run. So when you're all ready, you can go ahead and close out of all this stuff and you can move on to the next lecture where we will talk about setting up a love project.