Programming Environment in Lua

Kyle Schaub
A free video tutorial from Kyle Schaub
Software Engineer
4.7 instructor rating • 2 courses • 7,652 students

Learn more from the full course

Lua Programming and Game Development with LÖVE

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

08:24:24 of on-demand video • Updated August 2020

  • 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. And 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. Voice 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 a code and love to do games. I personally find TVs code to currently be the best option for a 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 that visual studio dot 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 in Sterling, 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 let us write our LUA code very easily in order to run our Lua code directly with love, though, it'll be helpful to have a certain extension installed. VTS code allows us to install extensions which are just 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 to d, the first option should be love to 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 to do projects, but most of all it lets us easily run love to decode directly from our editor. Before we close out of this, we do need to check some settings on this extension. So we 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 to DPF. This is the path to love you when you installed love 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, love that Yuxi. And I encourage you to go to this path in a file explorer or something and verify that there is a love that you see in this folder. If there isn't, then you 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 already, 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.