Advertisement
How to Learn

How to Learn LÖVE (Love2D)

by

LÖVE (aka Love2D) is a free, lightweight gamedev platform developed by a vibrant community, enabling everyone to create 2D games relatively quickly. In this article, we'll introduce you to the LÖVE platform and its capabilities, and share books, tutorials, and suggestions to get you started developing games with it.


What Is LÖVE, and What Can It Do?

LÖVE is an *awesome* framework you can use to make 2D games in Lua. It's free, open-source, and works on Windows, Mac OS X and Linux.Taken from love2d.org

The LÖVE platform is developed in C++ and implements some great cutting-edge techniques. The relatively short learning curve of LÖVE means you can start developing immediately - this is largely thanks to LÖVE using the lua programming language, which is fairly simple to pick up. Furthermore, the engine has a self-explanatory structure.

LÖVE in Action

Most of the games built with LÖVE are created by indie developers; check out this list for some examples.

Here are two great LÖVE games:

Mari0: This is one of the most impressive LÖVE games out there. It is a hybrid of Mario and Portal, creating a mind-blowing result.

Snayke: Snayke can be summed up in three words: snake on steroids.

As you can see, LÖVE is quite powerful.

Notable Features

  • Networking abilities
  • Box2D ported implementation (physics)
  • Support for many image and audio formats
  • Particle effects
  • User-created libraries (plugins)
  • Uses the super flexible license (zlib/libpng license)

Since LÖVE is open source, you are free to use the engine for commercial purposes.

Is LÖVE Bulletproof?

As mentioned above, LÖVE is mainly used for 2D games. While 3D tricks can be implemented, LÖVE was not created for these type of games. I'd also add that LÖVE is officially supported only for desktop machines.


Installing LÖVE

First you will need to download the latest version of LÖVE.

Then just go ahead and install it - it's as simple as that!

LÖVE has no official IDE (Integrated Development Environment) yet, so you will need to choose a preferred editor, such as:

Here is a nice tutorial on choosing the right one for you: Windows / OSX. (Written By Headchant.)


Learning Lua

Let's start by learning some lua.

As mentioned earlier, lua is the programming language LÖVE uses, so you will need to have at least some idea of how lua works to be able to create your game. Fear not - it is not that hard.

Lua is quite strong in the game development industry; some examples of games which use (usually embed) lua are: Garry's-mod, Baldur's GateCompany of Heroes, and Crysis. It's also used to power Roblox games.

Lua is used so much mainly because it is easy to learn, extensible, lightweight, simple to embed, portable, and has OOP (Object Oriented Programming) capabilities.

If you really want to get serious and learn lua in depth, I recommend Programming in Lua, Third Edition:

Programming in Lua, Third Edition
Programming in Lua, Third Edition

If you already have some past experience with programming, then I also recommend Michael Ebens' four-part Lua for Programmers tutorial series:

  1. Variables, Operators, Loops and Functions
  2. Tables, Strings, Numbers & Math
  3. Blocks and Scope, More Function Concepts, Loading files and Metatables
  4. Tips and Tricks

Michael Ebens' entire blog, Nova-fusion, is a great place to start learning lua and LÖVE; I suggest bookmarking it!


Learning LÖVE

After learning lua, let's implement it with LÖVE. There are plenty of tutorials out there waiting for you to read them. But what will it add if you "zig-zag" between advanced and novice tutorials? Nothing!

So here's a breakdown of the tutorials into difficulty level and suggested order:

Official Tutorials

First off, lets break the LÖVE's wiki tutorials into difficulty levels:

  1. Getting started
  2. Callback functions
  3. Using input
  4. Config Files
  5. Audio

All of the other tutorials in the wiki are quite advanced, so I suggest you return to them later on. In the meantime, check out some unofficial tutorials.

Unofficial Tutorials

Hello World in LÖVE
Hello World in LÖVE

Have a go at Vivid Reality's Hello World Tutorial. What better way to start off than with a simple hello world game?

Next, to understand how LÖVE draws, including how it handles origins (drawing offsets), check out this tutorial.

Want to create a tile-based game? I recently found a great git-hub hosted tutorial with source code. (Created by kikito)

And as I mentioned above, Michael Ebens' blog Nova-Fusion has lots of great LÖVE tutorials.

Invaders Must Die

Invaders in-game screenshot.
Invaders in-game screenshot.

Now that you feel more comfortable with lua and LÖVE, try creating a real game!

Create a classic invaders game with this two-part tutorial from Headchant:

  1. The LÖVE engine, Animation, Input
  2. Enemies, Bullets, Background Image

I Prefer Video Tutorials!

Josefnpat has made a great screencast tutorial explaining how to build an old-school scrolling shoot-'em-up game.

On YouTube, check out:


Advanced Subjects

At this point you can start diving into the more advanced sections in the wiki:

These are the more general tutorials. If you need something more specific, head out to the full list of wiki-tutorials.


The Community and Plugins

Are you creating something specific, meaning there are no tutorials out there to help you out? Don't worry, the forums are here! The LÖVE platform is blessed with a great community willing to help and guide you though your obstacles.

Go ahead and sign up to the forums!

Another great aspect is the plugins (community created libraries). If you need a specific plugin to handle something like easy animations or networking, you'll probably want to check out the library section.

Here is a list of some libraries I recommend using:


Notes

To learn about distributing your game, take a look at the wiki page.

More info about ports:

Some examples are spread throughout the wiki. To view the code, change the .love file extension to .zip and unzip the contents.

If you are looking at distributing your game on the web, there is a libary out there for you: love-webplayer


Conclusion

We started out explaining what LÖVE is all about. Then we took a look at the lua language. Next we went through some resources for learning LÖVE, from beginner material to advanced topics (with the option to chose between video and text) like networking and physics.

By now you are probably ready to create your own game. Good luck, and let us know how you get on!

Related Posts
  • Code
    Corona SDK
    Getting Started with Lua and the Corona SDK35613 preview image@2x1
    In this tutorial, you will learn the basics of the Lua programming language and I will help you getting started with writing applications for iOS and Android. Excited? Let's dive right in.Read More…
  • Game Development
    How to Learn
    How to Learn PolycodeHow to learn polycode
    Polycode is a free, open-source (licensed under the MIT license), and cross-platform "framework for creative coding". This term is seldom heard inside the game development community, but what it basically means is simple: Polycode provides you with tools to express your creativity through code, and although it is fully qualified to bear the "game engine" moniker, it prefers not to.Read More…
  • Game Development
    How to Learn
    How to Learn OrxHow to learn orx
    Orx is an open source, portable 2D game engine, which currently runs on Windows, Mac, Linux, iOS and Android (2.3+), and uses OpenGL (ES for iOS/Android) for render acceleration. It's data-driven, and uses a simple yet powerful configuration system which allows you to quickly prototype and validate ideas. In this article, I'll share tips and resources for learning Orx, and show you what it's capable of.Read More…
  • Game Development
    How to Learn
    How to Learn Loom SDKHow to learn loom sdk 400px
    Loom SDK is an open source cross-platform development kit, written in C++, that enables you to create games and applications for different platforms very quickly. It offers a command line interface and features such as live asset reloading, live code compiling, and multiple devices deployment, while preserving the flexibility of a native and open source SDK.Read More…
  • Game Development
    How to Learn
    How to Learn GameMaker: StudioHow to learn gamemaker studio 400px
    GameMaker: Studio is a full game development tool, featuring a level editor, asset manager, code editor, and its own scripting language known as GameMaker Language (GML). Earlier versions of GameMaker were were very basic, and many people will remember them as being mostly for total beginners - to make a game commercially with them would have seemed like a joke. Things are different now, with several commercial successes, including some very high profile games.Read More…
  • Game Development
    How to Learn
    How to Learn Ouya GamedevOuya hires
    The next generation of game consoles is here. This time around, nipping at the heels of the giants (Sony, Microsoft and Nintendo) are the microconsoles: less powerful, cheaper, and more welcoming to indie game developers. The superstar of this new family of game consoles is the Ouya. In this How to Learn guide, we'll introduce you to the Ouya platform and its capabilities, share links to resources, and present a few suggestions to get you started developing games with it.Read More…