When it comes to 2D game development frameworks, there are many options out there for indie game developers. Every framework has its own pros and cons, and its own use cases. Today, let’s talk about LÖVE, baby.

LÖVE is an awesome framework to make 2D games in Lua. With some modification, these games can be brought to libretro though Lutro. With the advent of C++14, are there tools and features we can bring in to improve the scripting experience behind developing 2D games?

Meet ChaiLove, an experiment in porting LÖVE to ChaiScript. Some of the goals behind this endevour include:

ChaiScript: The Lua scripting language is amazing, and is widely adopted. Having ChaiScript natively implemented directly in C++ means it’s easily embeddable, and has out-of-the-box support for many of the standard libraries already available.

Cross-Platform: Currently available on Windows, Mac OS X, Linux, and ARM. More platforms to come.

Proudly Found Elsewhere: Adopt third-party libraries whenever possible to reduce development times and improve maintainability

LÖVE API-inspired framework: Much of what you already know from LÖVE will look familiar in the ChaiLove API.

Examples

It’s pretty easy to get started with ChaiLove, just check out these code snippets.

Drawing text

def draw() { love.graphics.print("Hello World!", 400, 300) }

Drawing an image global whale def love.load() { whale = love.graphics.newImage("whale.png") } def draw() { love.graphics.draw(whale, 300, 200) } Playing a sound global music def load() { music = love.audio.newSource("music.wav") love.audio.play(music) }

For more information on ChaiScript, see the ChaiScript language reference.

Case Study: Floppy Bird

Floppy Bird is an example of what a ChaiLove game could look like. The game is a re-imagining of Flappy Bird using ChaiLove. It features rotating sprite graphics, music, sounds, a high score, save state support, and more. It’s available to download from the project releases, or directly through RetroArch:

Online Updater → Core Updater → ChaiLove Online Updater → Content Downloader → ChaiLove → Floppy Bird.chailove Load Content → Downloads → Floppy Bird.chailove

The following video shows not only how to download the ChaiLove core and Floppy Bird, but also some gameplay:

What’s Next?

ChaiLove has a few places where it could grow, and we’ll need your help for it to get there. Some ideas include:

Resources