Skip to Content

Category:Lua

A whole lotta LÖVE (for Lua Game Programming)


Lua is a popular language for game development and used to script add-ons etc. I have always wanted to learn more about Lua in a game development sense. But learning Lua can be daunting, especially if you don’t have the right tools or the right teacher. You can look for tutorials on the internet but they are few and far between, and the quality can vary dramatically. It is difficult for beginners to get a firm grasp on content when their only option is to navigate the technical documentation that can sometimes baffle even the most seasoned programming veteran.

Love Lua Level!

I discovered that I can hit two birds with one stone with a book from Packt Publishing called LÖVE for Lua Game Programming. With this great book you can begin learning Lua and game development at the same time (not bad!). How can you do that exactly? Well that’s where the LÖVE framework comes in. LÖVE is a easy to learn open-sourced game framework to get you creating 2D games quickly and professionally with no cost (The framework is free!). I have been following the tutorials in the book and after a very short time and I was already coding user input to make sprites move across the screen.


A pro tip: If you are using Notepad++ make sure you set the encoding to UTF-8. By default mine was ANSI and the Lua file wouldn’t compile.


Overall the book was worth it and pretty cool. I would recommend it to anyone who is looking for a quick and easy way to jump into game development for the desktop. Also learning Lua is quite impressive too, once you’ve learned the basics you can use this to leap into more complex scripting and possibly make your own custom ad-on to almost any popular desktop games.


love3

Lua – One of the most popular scripting languages for games, and learning Lua just got easier.

I’ve always wanted to learn Lua. The reasons were not academic. I really want to learn Lua so I can implement my own scripts and custom add ons to games. I am constantly learning and reading about programming, whether it’s browser quirks or how foreach actually works in PHP or random articles I find on the internet about programming in general. The world is filled with knowledge and there isn’t enough time to learn it all, so the best way to get around this is to take advantage of what others have compiled for you. For this, I have made a compilation of compilations of a few resources that can help you get into the action of Lua as fast as possible without skipping a beat, and without missing important concepts.

Lua was created in 1993 by Roberto Ierusalimschy, Luiz Henrique de Figueiredo, and Waldemar Celes, members of the Computer Graphics Technology Group (Tecgraf) at the Pontifical Catholic University of Rio de Janeiro, in Brazil.

What is Lua?

Lua, began in Brazil in 1988, out of Brazil’s strong trade barriers that restricted software from abroad. So, they had to create their own and with necessity is the mother of invention so came Lua, according to wikipedia. Read this interview to learn more about the author of Lua.

Lua is a scripting language, that is interpreted. You can code, and run it immediately. It is dynamically typed. It has a built in (incremental) garbage collector. It also has some features that some scripting languages do not have, such as coroutines, first class functions with lexical scoping, proper tail calls, etc. It is an embeddable language, as in you can use it as an add in to attach to a program. It has a clear API for host applications. One of the most important reasons for creating this language was, not to use it for the main application but to use it to attach to application to add functionality. In this way, using it for games really demonstrates exactly what it was meant to do. Here are a list of games that use Lua in that way. ALso, recently (2012) wikipedia chose Lua as it’s scripting language of choice. Read about that here.

Lua Tutorials and lectures:

  • Learn Lua in 15 minutes
  • Garry’s Mod Tutorials
  • Lua Bible
  • Lua workshop presentations 2012
    • Textadept – Behind the Scenes PDF – Video
    • Crazy Ivan – Lua Driven Robots – Video
    • Gemini – An Open Source Library for Game Development on iOS Using Lua – PDF Video
    • picoDB: a no-SQL database tool for eLua – PDFVideo 
    • Luerl, a Lua VM written in Erlang Video
    • LuaFlow – An Open Source Lua OpenFlow Controller – Video
    • Lua multi VM system for home automation PDF Video
    • Building a Lua Based Platform (Luvit) PDF – Video
    • Small Team, Huge Game, and Lua – Video
    • What is Next for Lua? A Personal Perspective PDF Video
    • Incrementally developing and implementing Hirschberg’s longest common subseqence algorithm using Lua –  PDF Video
    • Adding an Lua-based integrated character-based menu system into the SciTE editor – PDF Video
    • Integrating Lua for fun and profit: Vim’s if_lua and PostgreSQL’s PL/Lua – Video
    • Make Your Own M2M Application, in a 1/2 Hour, with Lua – Video
    • Using Lua for Integration with a specialized IDE – PPT PDF Video 
    • Lua Q&A Session with Roberto Ierusalimschy – Video
  • Zero Brane Studio IDE has some built in Lua tutorials

Why use Lua? Why not another scripting language? If you don’t know, you aren’t alone. I didn’t know either. To get a better idea of why you would choose Lua rather than other scripting languages check out this page that compares different languages, displays benchmarks and has great write ups on the differences. One day when I have time I would like to go through all of these to get a good sense on Lua. Here. You can also check out this blog post.