Skip to main content
CF

Master the Lua Scripting Language

13h 59m 27s
English
Paid

This course is a comprehensive immersion in the Lua programming language - one of the most popular scripting languages in the world. Lua is fast, compact, and easily integrates with C and C++, making it an excellent choice for extending and scripting applications in C and C++.

The course consists of three parts:

The first part is aimed at beginners and covers the basic elements of Lua. We will start with the very basics and explore topics such as variables, expressions, conditions, loops, functions, tables, object-oriented and functional programming, as well as popular Lua modules and tools.

The second part is intended for intermediate developers who want to learn how to integrate Lua into C or C++ projects. We will discuss how to embed Lua in a compiled application using the powerful Lua C API.

The third and final part consists of bonus lectures explaining how Lua is used in Roblox Studio. Roblox is a popular game engine that uses a dialect of Lua as the primary scripting language.

Necessary Tools

You will only need a Lua interpreter. The official Lua tools support cross-platform functionality, so you can work on Windows, macOS, or Linux.

Is this course suitable for you?

The course requires no prior knowledge. We will start with the official Lua language from scratch, so even beginners with no programming experience can confidently join!

What makes this course special?

The course is entirely dedicated to Lua! We will learn how to think like Lua programmers, understand the syntax and popular modules. Unlike most Lua resources, this course also covers integrating Lua with C and C++ code! We will learn to work with the Lua C API to embed Lua into C projects, making Lua a full-fledged scripting language.

About the Author: Gustavo Pezzi

Gustavo Pezzi thumbnail

Gustavo Pezzi is a UK-based computer-science lecturer (Pikuma) and one of the most distinctive teachers working at the intersection of low-level programming and game development. His material is unusual in the modern course market for how deep it goes into the foundations: assembly, computer architecture, classical raycasting / rasterisation algorithms, and the math underneath modern graphics.

His CourseFlix listing reflects that range: courses on 3D Computer Graphics Programming, Raycasting Engine Programming, 2D Game Physics Programming, NES Programming with 6502 Assembly, PS1 Programming with MIPS Assembly & C, Atari 2600 Programming, Compilers, Interpreters and Formal Languages, plus C++ engine programming and Lua scripting. Material is paid and aimed at developers who want to understand systems from the ground up rather than ship CRUD apps.

Watch Online 96 lessons

This is a demo lesson (10:00 remaining)

You can watch up to 10 minutes for free. Subscribe to unlock all 96 lessons in this course and access 10,000+ hours of premium content across all courses.

View Pricing
0:00
/
#1: Motivations and Learning Outcomes
All Course Lessons (96)
#Lesson TitleDurationAccess
1
Motivations and Learning Outcomes Demo
03:14
2
History and Language Goals
27:53
3
How to Take this Course
02:59
4
A Message for Roblox Users
01:40
5
Using Lua with REPL
03:31
6
Installing Lua on Linux
02:03
7
Installing Lua on macOS
01:04
8
Installing Lua on Windows
11:30
9
Our First Lua Script
09:06
10
Variables
16:36
11
Using REPL with Lua 5.1
05:27
12
Proposed Activity: Variables
02:10
13
Variables Activity Solution
04:16
14
Incrementing and Decrementing Values
06:54
15
Conditional Statements
09:18
16
The Elseif Statement
11:26
17
Proposed Activity: Conditionals
04:14
18
Conditionals Activity Solution
10:26
19
Logical Operators
06:09
20
String Manipulation
19:14
21
Multi-line Strings
04:38
22
Reading the Contents of a File
08:19
23
Multiple Assignment
03:36
24
Popular Standard Library Modules
10:18
25
Lua String Patterns
03:07
26
The For Loop
06:17
27
The While Loop
10:59
28
Loop Options
02:32
29
Variable Scope
04:02
30
Local Scope and Lua Chunks
02:38
31
Syntax and Semantic Errors
04:14
32
Solving Logical Mistakes
02:50
33
Inputting Values from the Keyboard
13:25
34
Handling Input Options
05:44
35
Input Options
04:28
36
Finding Distance Between Points
09:59
37
Finding Angle Between Points
12:00
38
Proposed Exercises on Loops
05:54
39
Proposed Exercise Walkthrough
08:36
40
An Introduction to Lua Functions
14:14
41
Lua Tables
22:16
42
Table Example
08:04
43
Proposed Activity: Looping Table Entries
06:53
44
Looping Table Entries Solution
09:27
45
Example of Tables as Configuration Files
04:40
46
Tables as Matrices
05:45
47
Formative Project: Tic-Tac-Toe
16:20
48
Moving Forward
02:09
49
Metatables
19:57
50
Object-Oriented Programming in Lua
21:52
51
Creating Classes and Objects
13:35
52
Higher-Order Functions and Closures
07:14
53
Examples of Higher-Order Functions
06:44
54
Variadic Functions
07:04
55
Integrating Lua with C
02:16
56
C Project Folder Structure
12:50
57
Executing Lua File from C
19:48
58
Get Lua Global Values in C
12:02
59
Accessing the Stack
05:52
60
Push Pop and Peak
01:55
61
Calling Lua Functions from C
12:21
62
Checking for Script Errors
05:10
63
Calling Native C Functions from Lua
17:44
64
Userdata
05:32
65
Sending and Receiving Userdata
14:34
66
Reading Lua Tables in C
06:03
67
Installing SDL
07:38
68
Creating SDL Window
13:59
69
The Game Loop
14:26
70
SDL Rendering
11:22
71
Fixing the Game Loop Timestep
13:55
72
Update as a Function of Delta Time
05:49
73
Controlling the Player Movement with Lua
26:01
74
Final Considerations on Lua and C
06:20
75
Next Steps
04:15
76
Lua and Roblox
02:25
77
Accessing Roblox Studio
05:45
78
Roblox Parts and Properties
12:15
79
Roblox Vectors and Colors
11:02
80
Roblox New Object Instance
06:08
81
Proposed Activity: Sun & Moon Script
05:48
82
Sun & Moon Script Activity Solution
09:43
83
Roblox Loops and the Wait Function
07:22
84
Roblox Loops and Conditionals
09:02
85
Roblox Events
10:25
86
Roblox Humanoid Properties
16:44
87
Roblox Players and Characters
10:00
88
Roblox Models and Assets
06:48
89
Roblox Terrain Editor
03:59
90
Roblox Lighting and ClockTime
09:19
91
Roblox Leaderboard
08:46
92
Roblox Debugging
02:53
93
Roblox CFrame
07:47
94
Roblox Following Parts
11:02
95
Getting Help with Roblox
05:14
96
Building Lua 5.4 from Source on Linux
08:08
Unlock unlimited learning

Get instant access to all 95 lessons in this course, plus thousands of other premium courses. One subscription, unlimited knowledge.

Learn more about subscription

Related courses

Frequently asked questions

What are the prerequisites for enrolling in this Lua course?
This course is designed for individuals with a basic understanding of programming concepts. Familiarity with scripting languages or experience in C or C++ can be beneficial, as Lua integrates well with these languages. However, the course covers fundamental concepts like variables, conditionals, and loops, making it accessible to beginners willing to learn.
What kind of projects will I build during the course?
The course includes a formative project where students develop a Tic-Tac-Toe game using Lua. This project helps apply concepts such as tables, loops, and functions. Additionally, various proposed activities and exercises, like looping through table entries and solving logical problems, reinforce practical application of Lua programming.
Who is the target audience for this Lua scripting course?
The course is aimed at aspiring programmers, game developers, and software engineers who wish to learn Lua for scripting and extending applications. It's also well-suited for those interested in integrating Lua with C or C++ projects. A lesson specifically addresses Roblox users, indicating a focus on game development contexts.
How does the depth of this Lua course compare to other scripting language courses?
This course offers a comprehensive exploration of Lua, with 96 lessons covering fundamental and advanced topics, such as metatables, object-oriented programming, and Lua-C integration. The detailed focus on these areas provides a deep understanding that may surpass introductory courses in other scripting languages.
What specific tools or platforms will I use in this course?
Students will set up Lua on Linux, macOS, and Windows, and use the Lua REPL for interactive scripting. Lessons also detail integrating Lua with C, including executing Lua files from C and accessing global values, providing practical insights into multi-language development environments.
What topics are not covered in this Lua course?
The course does not explicitly cover Lua's use in web development or mobile applications. The focus remains on Lua's integration with C and C++, scripting within applications, and fundamental programming concepts, without venturing into domain-specific applications beyond game development.
How much time should I expect to commit to this course?
With 96 lessons, the course requires a significant time investment to fully grasp the Lua scripting language. While the exact runtime isn't specified, the comprehensive nature suggests a commitment of several weeks, including time for practical exercises and the formative project, to master the material effectively.