Defold Tutorial – Learn to Create 2d Games
If you are anything like me, you love a good 2D game, specifically side scrollers. Games like Castlevania: Symphony of the Night helped me develop into a more thoughtful and detail-oriented gamer and person going forward.
3D games are great and all, but 2D has immense creative potential just beneath the surface. When it comes down to it, what is a good 2D game engine?
Looking to make some seriously cool little 2D titles? I’ve got just the thing. It is called Defold, and it allows developers to create dynamic 2D titles with relative ease.
But before you get started, it would be best to brush up on some literature. No, not the Great Gatsby or Lord of the Flies; I’m talking about documentation and proper tutorials to help you get started in using Defold.
Defold Game Engine
What is Defold?
Defold is a 3D engine that helps create 2D games. This mixture of both 3D and 2D offers great potential for your creative ideas. Defold is used by game studios like King, Sneaky Box, and Seepia Games.
What Language Does Defold Use?
It uses Lua, a gaming programming language that is tailored toward simpler apps. Lua is great for its versatility, speed, and ease of use.
Looking at the examples of things released using Defold, it is truly impressive. Action-packed shooters, and charming, quaint side-scrolling adventures, a la Braid.
On Defold Games, they have a list of games that have been made by the Defold community. I was surprised when I clicked on one example and was immediately allowed to play it right on my browser. That’s how easy the integration is.
I played ‘Look, Your Loot! This is an interesting card game that reminds me of heavy hitters like Hearthstone. It has a unique art style that reminds me a lot of Redwall and Ghost of a Tale.
I also played a game called ‘Beyond the Fairy Tale’, a charming little RPG in which the hero moves to different hexagonal tiles to progress on the map. It is also difficult too; a lowly mosquito killed me a bunch of times.
The game has a nice sense of humor and doesn’t take itself too seriously. It also has great voice acting, an awesome aspect to smaller titles that is rare these days.
With all of that said, let’s begin the tutorial, where I will walk you through some of the steps and direct you towards some seriously helpful links and sites to take your design to the next level.
Getting Started: Installation & Other Basics
Ready to start making games?
Step 1: Install Defold
Well, get your installer ready. First, you will need to log in with a Google account to get to the download screen. After that, you are given a few options for downloads: Mac, Windows, and Linux in 32 and 64-bit. After extracting the files to your desired folder, you can get started right away with making a new project.
Step 2: Start a New Project
Starting a new project in Defold is incredibly simple. You need only to choose from ‘start from scratch’ or ‘show me the ropes’.
If you choose tutorials, it will give you the options of viewing tutorials specific to certain 2D game styles: side-scrolling, Magic-link, and platformers. After that, Defold starts to show you the heavy lifting it will ultimately do for you.
Step 3: Save Your Project
Saving and pulling up your project is as easy as clicking a desktop shortcut icon.
Defold already has scripts and prefabricated elements ready for use from the get-go. This allows the user to be able to insert pre-existing assets into their project for a great little beginner’s boost.
I will let the rest of the resources do the talking for me, as I believe letting the experts explain is your best bet for learning the ins and outs of the engine.
Resources To Use
There are some valuable resources that I have found from my expert scrounging of the Internet. Out of all of them, here are the few that I believe will help you most when it comes to Defold.
This is as black & white as it gets here. Set up in an accessible and easy manner, the site lists out all of the steps that you will need to know to get those gaming juices flowing.
This tutorial is exhaustive in the best way; it leaves little to the imagination except for your ideas for games, which will be closer to reality because of this guide.
Games from scratch also have a companion piece to this written tutorial in the form of an informative video, Defold Game Engine Crash Course Tutorial.
For people who are more visual learners like me, this crash course video is essential viewing for progressing towards your creative goals. The narrator is extremely helpful, in a friendly, casual manner that’ll pull you in immediately.
Clocking in at about an hour and thirteen minutes, this covers a ton of info. Games from scratch have outdone themselves with this series, as it is some of the best tutorial work with Defold, as well as tutorials with game engines in general.
What better place to learn the ropes than from the people who made the engine themselves?
The makers of Defold lay out a comprehensive tutorial for curious users, including in-depth articles on the different types of 2D games available for use. These are very general step by step, and eventually, they link to Github for some more in-depth looks at the specific genre tutorials.
In their older tutorials, the Defold team outlines all of the specific lines of code that you’ll need to type out to make the ideal platformer. For example, if you wanted to calculate velocity change for a frame, you would type in ‘local dv = acceleration * dt’ and follow it from there. That specificity and step by step helpfulness could mean the difference between floundering during the game developing process and thriving.
Of course, it is recommended that you have some programming knowledge before use, but that goes for nearly every game engine.
Pros and Cons of Defold
I compiled a few pros and cons for Defold, measuring the consensus in the developing world.
- Easy to learn
- Lua makes this easy
Many creators like Lua as a programming language as opposed to something like C++. Lua is cross-platform, making it easily accessible to almost everyone. Its versatility is only matched by its ‘multi-paradigm’ language, meaning that it covers a slew of different solutions for many different problems, keeping them all under the same umbrella, i.e. easier to fix and deal with.
- Quality visual editor
After playing the demos for the different titles on Defold, I can confirm that the visual potential is amazing. For a free engine to be making stuff that looks this good seems like there should be a catch to all of this.
- A good community
An aspect that serves an engine extremely well is a strong community acting as the backbone for an engine. This is where you can get tips, tricks, and shortcuts into developing something that perhaps you are struggling with. Check out any of the forums or message boards that are associated with Defold for some great insight into the engine and what other developers are working on.
- Hot Reload
Defold allows editing while the game is running, something truly impressive.
You can download the engine straight from the site, easily and quickly. No trials or subscriptions.
- Google Account
For a con, I would say that this is pretty minor. Of course, it could be a hassle for some to constantly login with a Google account. But if you are already a user of Gmail, etc., then this shouldn’t be a problem. On Slant, people agreed that this was a minor con and didn’t affect the overall use of the engine, but rather someone’s personal preference for interface usage.
So, there you have it: Defold in all of its free, pretty, and easy glory. If you are a 2D fan, especially if it includes 3D elements, Defold is a great starting point for you and your potential creative projects.
Also, check out that stacked pros and cons list. I haven’t seen a list that lopsided in a long time. It is simple to download, simple to use, and produces some seriously impressive results.