Let’s build a game! – 2D Scrolling Shooter in Lua and LÖVE (Part 2)

Welcome to the second part of our first Let’s build a game! series. If you’re not a fan of project organization and management, you might want to skip this part, provided you’re reading it after I’ve posted the third part of the series and you actually have something to skip to. If you’re a fan of project organization and management, read on. If you’re unsure whether you’re a fan of P.O & M. (it’s painful to write that down every time) or not, give the wall of text below a try. You might become a fan after all.

The Developer’s Handbook

In this part we’re going to take a look at the developer’s handbook concept. What I call a developer’s handbook is a document that describes the outline of its parent project. It’s short (when compared to the whole project), to the point, and it helps a bunch. If you ever stop working on your project for a while, it can help you remember the most important things you might have forgotten. Also, if you need to focus completely on particular features, the handbook can act like a to-do list. In case you need to start a quest for assets, the handbook can tell you what to search for at all times. And, of course, if another developer joins your team, you can share the handbook with them so they know exactly what’s going on.

The handbook is not a single-write document. During development you may find that certain features you’ve thought would be amazing are actually not fun at all. Thus, you may wipe them from the handbook. At other times, you may think of completely new features, that are more fun. Those should be added to the handbook too. Just make sure the people who are working with you have access to the latest version of the handbook at all times.

There is also no unique recipe for a handbook. Its structure, size, pretty much everything, can vary from project to project. However, there are three sections that, I believe, could be successfully integrated in a handbook regardless of the project it’s being written for. These three sections are:

  • A short summary of the project. What it is about, a list of any other similar projects to be looked at as reference and so on.
  • A comprehensive list of high level features. In case you have a hard time splitting your project in distinct high level features because you can’t tell what a high level feature actually is (I made this term up, but I believe it makes sense), just concentrate on what the end user should be able to see, hear, and interact with. A visual interface is a feature. In a FPS, guns form one big feature that can be split in smaller features (guns equals M4A1 + Railgun + RPG + Glock + Machinegun and so on). Online multiplayer is a feature for a game that… features (see it now?) such a thing. Time manipulation, as in Braid, the indie platformer, is a (pretty awesome) feature too.
  • Any important or extra details on the features listed above. Perhaps that time manipulation feature is a bit more interesting than what can be found out there already? Sine Mora, the (just as indie) 2D side scrolling shooter shows a nice take on the time manipulation concept, for example. Write info on all of those particularities here.

Writing tip! Even if you’re working solo on your project, while writing the handbook, imagine there’s a team of developers waiting for the document so they can start developing the actual game. You’re not in the mood to answer a massive amount of questions, and don’t have the time either. Write the handbook in such a way that said developers would not need to ask too many questions. Keep it clear and cover as many details as possible.

Keep in mind the following: the whole concept of developer’s handbook is something I’ve adopted for usage inside of Vanilla and has proven to be a nice way to organize all in-house projects so far, but this is obviously my case, and the only case that I know of. It is by no means a standard in the industry. It is by no means a perfect way to organize a project, and is by no means something that you should follow blindly. Give the whole thing a try, and see for yourself how things turn out. If the handbook does the job for you, then congratulations are in order! I’d love to hear more about your exploits in the comments section.

To end the general talk, I’ll say that the whole handbook concept is pretty rough around the edges at the moment. In case you have suggestions for its improvement, the comments section is the place to write ‘em down.

Our Game’s Handbook

Our side-scrolling shooter’s handbook could do with the three sections above only, but I’ve added an extra section for a really nice diagram that somehow mirrors the whole handbook.

First of all, the tools I’ve used for this particular handbook:

  • For the writing part, I used LibreOffice Writer. It’s very well suited for any task I might happen to have to throw at it. It’s completely cross-platform, and as if that wasn’t enough, it’s also completely free. You can find it here.
  • For my favorite part, the diagram, I used yEd. It’s a great, free & cross-platform solution for drawing diagrams of any kind. Diagrams are neat. You can represent pretty much everything on a diagram and, with a bit of luck, it will make tons of sense. You can find yEd here.

But wait! We’re forgetting something. The name of the game! How can we build a game without giving it a name? Let’s call it… Pew-Pew!
Pretty catchy if you ask me. Feel free to call it differently though, if you do not like Pew-Pew!

Here’s the actual handbook I wrote, in pdf format. Check it out to better understand what Pew-Pew! is going to be: link.
In case you are interested in the source document and diagram, there’s a Microsoft Office-friendly doc right here. The graphml file for the diagram can be found here. I will also add the diagram to the article, so that it does not look like a boring wall of text. You think boring walls of text are bad too, right?

This diagram alone tells us what we need to keep our eyes on during development!

This diagram alone tells us what we need to keep our eyes on during development!

What’s next?

In the next part of the series we will (obviously) continue with the development of our side-scrolling shooter. We’ll gather and organize some assets by following the diagram above. We will also (finally!) write some code. Quite a lot of code, actually.

See you next time!

Let’s build a game! – 2D Scrolling Shooter in Lua and LÖVE (Part 1)

Note: The author will be using Microsoft Windows as underlying operating system throughout these articles. Since LÖVE is completely cross-platform (as far as Windows-Mac OS X-Linux goes), this does not matter too much. You are, however, expected to be at least a little bit familiar with the operating system you’re running. Since the articles won’t go in-depth about installing LÖVE on each platform, you should check LÖVE’s installation guide if the need shows itself. Keep these close to you:
https://www.love2d.org/wiki/Main_Page
https://www.love2d.org/wiki/Getting_Started

Hello there!
This is meant to be an introductory post to the first “Let’s build a game!” series here on Vanilla Code Snips. What’s it all about?
First of all, the series: on each “Let’s build a game!” article we will start with a plan and end up with a playable game. The programming language, framework, platform and actual game will differ from an article to another. And trust me, they’ll differ a lot. After all, who’d want to do the same things over and over?

The title also explains things pretty well. We’re going to build a 2D scrolling shooter and we’re going to use the LÖVE framework and Lua as programming language.

Tyrian is a great game among all scrolling shooters

Lua is a great programming language (though it’s actually a scripting language, I feel it would be better to avoid this difference, at least for this project) for both beginners and experienced developers. It can easily be grasped by beginners, and experienced developers know it’s a good choice when they need to keep things simple in those project areas that don’t require lots of performance tuning. There’s also quite a bit of reputation that Lua has when it comes to game development. The first thing that comes to my mind is World of Warcraft’s GUI that can be customized with Lua scripts.

LÖVE is a very friendly (to say the least) 2D game development framework. Friendly in every possible way. Actually, if you dig a bit through its website you might get the impression that LÖVE is trying to… LOVE the heck out of you. It’s also completely free for anyone to use in whatever way they see fit. Oh, and the most important aspect: I can’t think of any other framework that offers such a clean and simple starting point for a developer to build his game upon. It’s just great, and you’ll see why soon.

With these matters settled, I can go on and throw some (obligatory) links at you.

Lua’s manual (browse through it to form an idea about what we’ll be using here; you might want to try your hand at some simple tasks using Lua, as the article isn’t a Lua programming tutorial – at the time of writing, Lua’s latest stable release is 5.2.1):
http://www.lua.org/manual/5.2/

LÖVE’s main page (feel free to click on that download link now; be sure to select the appropriate download for your operating system):
https://love2d.org/

What you’ll be needing:

  • LÖVE to be installed on your system.
  • A text editor.

Installing LÖVE is no different from installing any other software on your machine. After installation, search for LÖVE’s executable – it can be found (obviously) where you installed it. The installer might have created additional shortcuts too. Start it, and you should see something like this (or if you’re from the future, something different).

ImagePigs and love, courtesy of LÖVE

As far as the text editor matter goes, any will do. Of course, you might want to use an editor that was specifically created with the programmer in mind. Personally, I use gedit, on all operating systems. It’s an old Ubuntu habit of mine. You can find it here:
http://projects.gnome.org/gedit/
Among the other options lie Notepad++, UltraEdit, SciTE (this one’s loving Lua as much as LÖVE loves us).

That should be all for the introduction. Throughout part 2, which will come very soon, we will discuss everything about the game we’re going to build. What will it contain? How will the player actually play it? What’s special about it? What are the core concepts that we’re going to meet with in our project? What guidelines should we write down for the actual implementation? And more.

Fire up your editors ladies and gentlemen, fun times lie ahead!