Lua is an extremely versatile and popular programming language that you’ll find embedded in many other applications like Adobe’s Lightroom or even World of Warcraft. Many developers are surprised to find that even very popular games like Angry Birds are written in Lua. In this course, you’ll learn how to quickly get started writing programs and scripts with Lua. I’ll take you through the basics of Lua, show you some tricks that demonstrate the Lua’s flexibility and even show you how to use Lua in an object oriented way. We’ll start off in this course by learning a bit about Lua itself and Lua’s history, as well as learn how to download Lua and use the popular SciTE IDE for creating and running Lua code. After we are setup and ready to develop some Lua code, we’ll learn the basics of Lua as we jump right in and build our first application. We’ll go over Lua’s type system and learn how to assign variables, utilize operators, use conditional logic and create loops. Once we’ve got the basics covered, we’ll explore two powerful concepts in Lua: functions and tables. We’ll learn how functions work in Lua and what makes them so powerful, and we’ll see how tables can be used for more than just storing simple data. Even though Lua itself doesn’t have a class construct, we’ll learn how to do object oriented programming in Lua using tables and metatables. Finally, we’ll wrap up the course by learning a little bit about the standard libraries that come with Lua. I’ll show you some examples of using some of the most useful functions in the standard libraries and show you where you can get more information about them.
Introduction Hi, this is John Sonmez from Pluralsight. And welcome to this course on The Lua Programming Language. Lua is a really easy-to-use and learn scripting language that is often embedded in other applications and games to provide support for scripting and extending that application or game. In this course, we'll cover the basics of Lua and also see how Lua's flexible meta table system allows us to implement many object-oriented concepts like classes and inheritance. Because of Lua's widespread usage and flexibility, it's a very valuable language to learn that would give you the ability to script and customize many different software systems, as we'll talk about a little later on in this module. By the end of this course, you should know enough about the basics of The Lua Programming Language to be able to build simple applications using Lua and create scripts for applications that use Lua as an embedded language.
Variables, Expressions, Statements, Blocks Hi. This is John Sonmez from Pluralsight. In this module we'll be going over some of the basic concepts in Lua like variables, expressions, statements and blocks. Now that you know a little about Lua and what it's used for and you're all set up with the Lua interpreter, it's time to actually learn the basics of the language itself. In this module, we're going to go over some of the basic concepts of the Lua language while we build a really simple application that will utilize some of these basic constructs. Even though we'll be learning the basics concepts here, we won't be spending too much time going into all of the little details of the syntax of the language. Instead, we'll focus on covering the most important things you need to know to get started as soon as possible. You can always fill in the details later once you know the basics. We will spend some extra time when dealing with some parts of the language that are a bit different than other programming languages, but for the most part, we'll be moving pretty quickly and trying to avoid going too deep into any particular topic. By the end of this module, you should be able to create a simple program with Lua that can read user input and make decisions based on that input.
Functions and Data Structures Hi, this is John Sonmez from Pluralsight and in this module we'll be learning about functions and data structures in Lua. So far, we've put all of our code in a single Lua file and we haven't organized that code in any way. For a simple program or script, this is acceptable, but as you create more complex Lua programs and want to be able to reuse parts of your Lua code, you'll need to organize your code in the form of reusable sections called functions. You'll probably also want to be able to have a way for storing data that doesn't require you to name new variables for each piece of data. What happens when you have a variable amount of data or you need or organize or manipulate that data in some way? That's where tables come in. In this module we'll cover both functions and tables and you'll learn how to use both of these important Lua features as we improve our existing guess my number game and create a few more simple programs.
Object Oriented Code Organization Hi, this is John Sonmez from Pluralsight and in this module we're gonna be learning how to create some object oriented code in Lua. Now as you may have picked up already, Lua is not inherently object oriented. What I mean by this is that there is no construct for a class or some of the traditional types of support in a language that you would expect in an object oriented language. Really Lua is a prototypical and functional language, but it can also be used in an object oriented way. In this module I'm gonna show you how to do this. Even though we don't have a definition of a class in Lua, we're gonna be approximating our own class and we're going to get some very nice object oriented features inside of Lua without having to really bend the language in a way that it's not meant to bend. Part of the value of Lua is its flexibility and that flexibility really allows us to create a nice object oriented solution. So by the end of this module you should have a good idea of how to create classes and objects in Lua and how to use Lua in an object oriented way.
The Standard Library Hi, this is John Sonmez from Pluralsight and in this module we're gonna be going over some of the standard library for Lua. Now the standard library for Lua is not all that large, but it does contain some really useful functions that will help you when you're writing your Lua code. In fact, we've already seen many of the standard library functions up to this point in the previous modules, but in this module we're gonna go over some of the most important points and I'm gonna show you a few examples of using some of the standard library. We won't have time to go over the whole library and to be honest with you, you probably don't need to know everything in the standard library at this point, but by the end of this module you should have a good understanding of what is available in the standard library and know how to use a couple of the most frequently used and most helpful functions that you'll find there.