
Lua Course
Learn Lua from the ground up and gain the programming skills powering game engines, embedded systems, and automation tools worldwide. This course takes you from your first script to advanced topics like coroutines, metatables, and the C API. Every concept is taught with practical, hands-on examples you can apply immediately.
What you will learn:
This course covers every essential area of Lua programming, starting with environment setup, syntax, and data types. You will master control flow, functions, closures, and Lua's powerful table system. The curriculum then moves into string manipulation, pattern matching, metatables, and object-oriented design. You will also learn to organise code into modules, handle runtime errors, and manage dependencies with LuaRocks. Advanced topics include coroutines, garbage collection, performance optimisation, and the Lua C API. Supplementary sections cover game development with LÖVE, system automation, testing with busted, and professional team practices.
How you study in practice Lua Course
How you practise Lua Course
For businesses looking to train their team
With Dedika for businesses, the course includes exercises and examples tailored to your own business and the way your company needs.
Course content
8 Chapters • 39 LessonsDuration between 4 and 360 hours (you decide)
Chapter 1HideHide detailsSee detailsLua Fundamentals and Environment Setup
Lua Fundamentals and Environment Setup
Lesson 1 • Variables and Data Types
Explains dynamic typing, nil, booleans, numbers, and strings. Students gain the ability to store and inspect values in any Lua program.
Lesson 2 • Lua Syntax and Code Structure
Introduces statement syntax, comments, and whitespace rules. Provides the grammatical foundation every subsequent script depends on.
Lesson 3 • Installing and Configuring Lua
Covers Lua runtime installation across major operating systems and editor setup. Connects to the chapter by enabling hands-on practice from the first lesson.
Lesson 4 • Basic Input and Output
Teaches print, io.write, and io.read for console interaction. Enables students to produce visible output and accept user input immediately.
Lesson 5 • Operators and Expressions
Covers arithmetic, relational, logical, and concatenation operators. Builds expression-writing skills used throughout all future chapters.
Chapter 2HideHide detailsSee detailsControl Flow and Program Logic
Control Flow and Program Logic
Lesson 1 • Break, Goto, and Loop Control
Explains break to exit loops and goto for controlled jumps. Completes the control-flow toolkit with safe, intentional use patterns.
Lesson 2 • Numeric and Generic For Loops
Teaches numeric for with step control and generic for with iterators. Prepares students for table traversal covered in the next chapter.
Lesson 3 • Conditional Statements
Covers if, elseif, and else syntax with nested conditions. Directly enables branching logic required by every non-trivial program.
Lesson 4 • While and Repeat Loops
Introduces while and repeat-until loops for condition-driven iteration. Students learn when each loop type best fits a given problem.
Chapter 3HideHide detailsSee detailsFunctions and Scope
Functions and Scope
Lesson 1 • Recursive Functions
Covers direct and mutual recursion with base-case design. Builds problem-decomposition skills applied in algorithms and data structures.
Lesson 2 • Multiple Return Values and Varargs
Explains returning multiple values and using the ... vararg syntax. Unlocks flexible function signatures common in Lua idioms.
Lesson 3 • Local vs. Global Scope
Distinguishes local and global variable lifetimes and visibility rules. Prevents common scoping bugs that arise in larger scripts.
Lesson 4 • Defining and Calling Functions
Covers function declaration syntax, parameters, and return values. Establishes the primary abstraction mechanism used throughout the course.
Lesson 5 • Closures and Upvalues
Introduces closures as functions capturing upvalues from enclosing scopes. Enables stateful function factories and callback patterns.
Chapter 4HideHide detailsSee detailsTables: Lua's Core Data Structure
Tables: Lua's Core Data Structure
Lesson 1 • Table Manipulation with table Library
Introduces table.insert, table.remove, table.sort, and table.concat. Equips students with standard library tools for common table operations.
Lesson 2 • Tables as Arrays
Explains integer-keyed sequences and the # length operator. Enables list-style data storage and sequential processing.
Lesson 3 • Table Creation and Access
Covers table constructor syntax and key-value access patterns. Provides the foundation for every data-modelling task in Lua.
Lesson 4 • Tables as Dictionaries
Covers string and mixed keys for map-style data storage. Connects to real-world use cases like configuration and record objects.
Lesson 5 • Tables as References
Explains reference semantics, shallow copies, and aliasing effects. Prevents data-corruption bugs when passing tables to functions.
Chapter 5HideHide detailsSee detailsStrings and Pattern Matching
Strings and Pattern Matching
Lesson 1 • Replacing and Iterating Patterns
Teaches string.gsub for replacement and string.gmatch for iteration. Completes the pattern toolkit for full text transformation workflows.
Lesson 2 • String Formatting with string.format
Teaches format specifiers for numbers, strings, and padding. Enables precise output formatting required in logging and reporting.
Lesson 3 • String Library Essentials
Covers string.len, string.sub, string.upper, string.lower, and string.rep. Builds the baseline text-processing toolkit for all string tasks.
Lesson 4 • Finding and Matching Patterns
Covers string.find, string.match, and capture groups. Enables extraction of structured data from raw text inputs.
Lesson 5 • Pattern Syntax and Character Classes
Introduces Lua patterns, anchors, quantifiers, and character classes. Provides the grammar for all find, match, and gsub operations.
Chapter 6HideHide detailsSee detailsMetatables and Object-Oriented Lua
Metatables and Object-Oriented Lua
Lesson 1 • Building Classes with Prototypes
Implements class constructors and method dispatch via __index chains. Students create reusable object blueprints with shared methods.
Lesson 2 • Inheritance and Polymorphism
Extends prototype chains for single inheritance and method overriding. Completes the OOP model with subclass and super-call patterns.
Lesson 3 • Arithmetic and Comparison Metamethods
Covers __add, __sub, __mul, __eq, __lt, and __le metamethods. Enables custom types to participate in standard Lua expressions.
Lesson 4 • Index and Newindex Metamethods
Teaches __index for property lookup and __newindex for write interception. Enables default values, read-only tables, and proxy objects.
Lesson 5 • Introduction to Metatables
Explains setmetatable, getmetatable, and the metatable contract. Establishes the mechanism underlying all advanced table customisation.
Chapter 7HideHide detailsSee detailsModules, Packages, and Error Handling
Modules, Packages, and Error Handling
Lesson 1 • Debugging with the debug Library
Covers debug.traceback, debug.getinfo, and hook functions. Gives students tools to diagnose issues in complex, multi-module programs.
Lesson 2 • require and Package System
Explains require, package.path, and module caching behaviour. Teaches students to load and manage dependencies reliably.
Lesson 3 • Custom Errors and Error Objects
Teaches error() with levels and structured error table objects. Enables informative, machine-readable error reporting in libraries.
Lesson 4 • Error Handling with pcall and xpcall
Introduces pcall and xpcall for protected calls and error capture. Prevents unhandled errors from crashing production scripts.
Lesson 5 • Creating and Using Modules
Covers the module-as-table pattern and returning public APIs. Enables code separation and reuse across multiple script files.
Chapter 8HideHide detailsSee detailsAdvanced Lua and Performance Optimization
Advanced Lua and Performance Optimization
Lesson 1 • Iterators Built with Coroutines
Builds stateful iterators using coroutine.wrap for clean syntax. Connects coroutine knowledge to practical generic-for usage.
Lesson 2 • Profiling and Performance Tuning
Applies timing, local caching, and table pre-allocation to reduce overhead. Students measure and improve script performance with concrete benchmarks.
Lesson 3 • Coroutines and Cooperative Multitasking
Introduces coroutine.create, resume, yield, and status. Enables cooperative scheduling and producer-consumer pipelines in Lua.
Lesson 4 • Memory Management and Garbage Collection
Covers the incremental GC, collectgarbage(), and weak tables. Teaches students to control memory usage in long-running applications.
Lesson 5 • The Environment and _ENV
Explains _ENV as the global table and chunk-level environment control. Enables sandboxing and dynamic global management techniques.
Your valid completion certificate
This course is for you:
Beginner programmers: eager to learn a lightweight, versatile scripting language.
Game developers: wanting to script logic inside engines like LÖVE or Defold.
C/C++ developers: looking to embed a fast scripting layer into their applications.
Automation engineers: needing a compact language for build tools and system scripts.
Computer science students: seeking a practical language beyond classroom Java or Python.
Career changers: transitioning into software roles through a focused, approachable language.
What our students say
Your lessons are perfect. I purchased the one-year package and finally have the opportunity to follow various topics of interest without needing to change platforms... I'm grateful for everything you do, I've already recommended you to other people...

I like how the lessons are straight to the point and how I can change chapters and skip content I don't need.

I like the content and the way videos are presented and transcribed, which speeds up the process!

The platform is fast and simple to use. The diversity of content and complementary videos really help with learning.

Top qualifications
FAQ
Who is Dedika?
Is the certificate valid in the United Kingdom?
Are the courses free?
What is the course workload?
What are the courses like?
How do the courses work?
What is the duration of the courses?
What is the cost or price of the courses?
What is an EAD or online course and how does it work?
PDF Course




















