Course description

This is a comprehensive course dedicated to the language Lua, one of the world's favorite scripting languages. Lua is fast, small, and super easy to integrate with C and C++, which makes Lua an excellent choice to extend and script compiled C and C++ applications.

This course is divided in three parts:

lua language tutorial

1. The first part is a beginner-friendly journey into the building blocks of the Lua language. We'll start from the very beginning and look at things like variables, expressions, conditionals, loops, functions, tables, object-oriented programming, functional programming, and other popular tools and modules of Lua.

lua language c api

2. The second part is aimed at intermediate-experienced developers that want to learn how to integrate Lua with their native C or C++ projects. We'll put our C-programmer's hat on and review how to embed the Lua programming language inside a compiled application using the powerful Lua C API.

lua roblox tutorial

3. The third and last part is a series of short bonus lectures. These lectures will explain how the Lua language is used inside Roblox Studio. Roblox is an example of a popular game engine that uses a dialect of Lua as its main scripting language.

The tools you'll need

All you need is a Lua interpreter. The official Lua tools are all cross-platform, which means you'll be able to code along on either Windows, macOS, or Linux!

c++ game engine platform

Is this course for you?

This course has no prerequisites. We'll cover the official Lua language from the ground up, so even beginners with no prior experience in coding are welcome to join!

This is not a course about creating Roblox games! Our main focus is Lua, the programming language.

How is this course different?

This is a complete immersion in the world of Lua! We'll learn how to think like Lua programmers, carefully covering the syntax and the most popular modules from Lua.

lua game scripting

Differently than most Lua resources out there, this course also covers the integration of Lua with native C and C++ code! We'll learn to work with the Lua C API to embed the Lua language inside a C project, exposing Lua to be used as a proper scripting language.

About the instructor

gustavo pezzi

Gustavo Pezzi is a university lecturer in London, UK. He has won multiple education awards as a teacher and is also the founder of pikuma.com.

Gustavo teaches fundamentals of computer science and mathematics; his academic path includes institutions such as Pittsburg State University, City University of London, and University of Oxford.

teaching certification
higher education academy
pgclt teaching certification
bpp university award

Course content

12 hours total length 14 Chapters Last updated January 2023
  • Motivations & Learning Outcomes
  • How to Take This Course
  • History of the Lua Language
  • Goals of the Lua Language
  • Using Lua in the Web Browser with REPL
  • Installing Lua on Linux
  • Installing Lua on macOS
  • Installing Lua on Windows
  • Our First Lua Script
  • Variables
  • Exercise: Variables
  • Incrementing and Decrementing Values
  • Quiz: Variables and Expressions
  • Conditional Statements
  • The elseif Statement
  • Exercise: Conditionals
  • Logical Operators
  • Quiz: Conditionals
  • String Manipulation
  • Multi-Line Strings
  • Multiple Assignments with Lua
  • Popular Standard Library Modules
  • Exercise: Strings and Random Numbers
  • The For Loop
  • The While Loop
  • Loop Options
  • Quiz: Loops
  • Variable Scope
  • Local Scope and Lua Chunks
  • Syntax Errors and Semantic Errors
  • Reading Values from the Keyboard
  • Finding the Distance Between 2D Points
  • Finding the Angle Between 2D Points
  • Exercise: Loops
  • Lua Functions
  • Exercise: Functions
  • Lua Tables
  • Pairs and Indexed-Pairs
  • Examples of Lua Tables
  • Exercise: Looping Table Entries
  • Tables as Arrays
  • Tables as Matrices
  • Exercise: Tic-Tac-Toe Project
  • Metatables
  • Exercise: Metatables
  • Object-Oriented Programming in Lua
  • Creating Classes and Objects in Lua
  • Quiz: OOP in Lua
  • Higher-Order Functions and Closures
  • Variadic Functions
  • Exercise: Variadic Functions
  • Coroutines in Lua
  • Starting our C Example Project
  • Executing a Lua File from C
  • Get Lua Global Values in C
  • Accessing the Lua Stack
  • Push, Pop, and Peak
  • Quiz: The Lua Stack
  • Calling Lua Functions from C
  • Checking for Script Errors
  • Calling Native C Functions from Lua
  • Working with Userdata
  • Sending and Receiving Userdata
  • Reading Lua Tables in C
  • Installing SDL
  • Creating and Rendering an SDL Window
  • Fixing the Game Loop Timestep
  • Controlling Player Movement with Lua
  • Exercise: Implementing the Rectangle() Function
  • Lua JIT
  • Next Steps
  • Lua and Roblox
  • Downloading Roblox Studio
  • Roblox Parts and Properties
  • Roblox Vectors and Colors
  • Roblox New Object Instance
  • Exercise: Sun-Moon Script
  • Roblox Loops and the Wait() Function
  • Roblox Loops and Conditionals
  • Roblox Events
  • Roblox Humanoid Properties
  • Roblox Players and Characters
  • Roblox Models and Assets
  • Roblox Players and Characters
  • Roblox Terrain Editor
  • Roblox Lighting and ClockTime
  • Roblox Leaderboard
  • Roblox Debugging
  • Roblox CFrame
  • Roblox Following Parts
  • Getting Help on Roblox Scripting
  • Versions of Lua
  • Building Lua 5.4 from Source on Linux
  • Conclusion and Next Steps

73% of our students come back for another course

We don't offer discounts on our courses. Ever.

What students are saying

5.00
5 star
100.0%
4 star
0.0%
3 star
0.0%
2 star
0.0%
1 star
0.0%
Olavo Marques Ribeiro da Costa Werlang
"Amazing course! As a beginner in programming, this course has been spectacular so far. Gustavo does a great job explaining Lua's logic, and gradually making it more complex. I'm ready to give the bonus lectures a go and start implementing and practicing what I learned, very excited to do so. The course feels like an excellent starting point for anyone interested in learning programming, Lua's logic is very simple and intuitive, and learning it will help when learning, bigger, more complex languages. Thanks Gustavo! Abraço do Brasil!"
15 Aug 2024
"One of the best intros to Lua out there. Concepts are explained in a very approachable way and the exercises have the right amount of challenge for beginners. 100% worth the asking price if you're getting started on Lua."
21 Jun 2024
Seann Zhane
"Excellent Lua Course! Easy to follow, clear explanation even good for first time programmer."
03 Mar 2024
Kris Inniss
Kris Inniss
"Great course! Apparent and concise instruction. Easy to follow along. I had a few hiccups on Windows OS but these difficulties are mentioned in the course."
18 Jan 2024
Vilas Chitrakaran
Engineer Ph.D., C.Eng.
"Absolutely amazing. Loved this course. The pace was right for me and I intend to use Lua as a scripting language in my projects. I hope to do other courses in Pikuma as well."
01 Oct 2023

Other similar courses

3D Computer Graphics Programming

35 hours
  • Create a 3D software renderer from scratch using the C programming language.
raycasting texture c

Raycasting Engine Programming with C

18 hours
  • Write a raycasting engine with textures and sprites using the C programming language.

Game Physics Engine Programming

35 hours
  • Learn how to create a 2D rigid-body game physics engine from scratch with C++.