This is the third post in a series of articles covering how I am building my pet project Boing, a scripting playground to create Amiga style cracktros.
In my previous post I described how the name Boing came to be and why I chose Löve2D to be the 2D engine I want to work with. This post covers my vision for Boing, my first contact with the Lua programming language and my first experiments with the engine.
What I want Boing to be
As I mentioned before Boing should be a scripting playground. I want to be able to write a simple script that completely describes a demo scene and feed it into Boing. Boing will then interpret and run the scene.
A scene script could look something like this:
To run it, simply pass it into Boing from the command line: $ ./boing myscene.lua
First steps in Löve2D
Getting started with Löve2D is incredibly easy. It is literally just downloading the binary, creating a main.lua
file and writing a simple love.draw()
function that prints “Hello World” on the screen. Although it is geared towards total programming beginners the How to Löve Tutorial by Sheepolution helped me a lot to get the basics of both Löve2D and Lua.
Can this relationship work?
One major concern I had was packaging, distribution and loading scripts. To test this I created a simple main.lua
file that parses the command line arguments for another file that it tries to execute.
I also created a test.lua
file that just had a print
command.
To my delight running it with love . testscript.lua
actually worked and printed the line in the terminal window. A quick test packing up everything in a macOS app bundle yielded the same result. Nice!
Next up will be implementing the basic architecture of Boing and coming up with a way to interpret a scene script.