As we moderate and verify new training materials, we will add them to this page. Feel free to comment if you have a tutorial that should be on this page. Thank you!
Table of Contents
Side scroller tutorial
Walking astronaut tutorial
Movement tutorial
Colorslide tutorial
War battles tutorial
Snake tutorial
The classic 15 puzzle tutorial
Shadertoy tutorial
Texture scrolling shader tutorial
Runner tutorial
Magic Link tutorial
Building a car tutorial
Creating online games using Nakama and Defold
Releasing HTML5 games on Yandex.Games
Releasing HTML5 games on Game Distribution
Shaders for Beginners
Grading tutorial
Pixel Line Platformer
Lights and Shadows
Roids sample game
Linker sample game
Shadertoy sample
RPG map sample
Platformer Tutorial
Side scroller tutorial
The tutorial is integrated with the Defold editor and easily accessible:
- Start Defold.
- Select New Project on the left.
- Select the From Tutorial tab.
- Select the “Side scroller tutorial”
- Select a location for the project on your local drive and click Create New Project.
Walking astronaut tutorial
In this beginner’s tutorial you learn how to capture player input and make a character move and animate. You will also learn about the core building blocks in Defold: game objects, components and collections. The tutorial is integrated with the Defold editor and easily accessible:
- Start Defold.
- Select New Project on the left.
- Select the From Tutorial tab.
- Select the “Walking astronaut tutorial”
- Select a location for the project on your local drive and click Create New Project.
Movement tutorial
In this beginner’s tutorial you learn how to make realistic movement using vectors and some simple vector algebra. The tutorial is integrated with the Defold editor and easily accessible:
- Start Defold.
- Select New Project on the left.
- Select the From Tutorial tab.
- Select the “Movement tutorial”
- Select a location for the project on your local drive and click Create New Project.
Colorslide tutorial
In this medium difficulty tutorial you build an in-game GUI, a GUI screen for level selection and a start screen for a simple multi level mobile game. The tutorial is integrated with the Defold editor and easily accessible:
- Start Defold.
- Select New Project on the left.
- Select the From Tutorial tab.
- Select the “Colorslide tutorial”
- Select a location for the project on your local drive and click Create New Project.
War battles tutorial
In this tutorial you will learn how to create a small playable game featuring movement and firing mechanics. The tutorial is integrated with the Defold editor and easily accessible:
- Start Defold.
- Select New Project on the left.
- Select the From Tutorial tab.
- Select the “War battles tutorial”
- Select a location for the project on your local drive and click Create New Project.
Snake tutorial
This tutorial walks you through the process of creating one of the most common classic games you can attempt to recreate. There are a lot of variations on this game, this one features a snake that eats “food” and that only grows when it eats. This snake also crawls on a playfield that contains obstacles.
The classic 15 puzzle tutorial
This well-known puzzle became popular in America during the 1870s. The goal of the puzzle is to organize the tiles on the board by sliding them horizontally and vertically. The puzzle starts from a position where the tiles have been scrambled.
The most common version of the puzzle shows the numbers 1–15 on the tiles. However, you can make the puzzle a bit more challenging by making the tiles part of an image. Before we begin, try to solve the puzzle. Click on a tile adjacent to the empty square to slide the tile to the empty position.
Shadertoy tutorial
Shadertoy.com is a site that gathers user contributed GL shaders. It is a great resource for finding shader code and inspiration. In this tutorial we will take a shader from Shadertoy and make it run in Defold. Some basic understanding of shaders is assumed. If you need to read up, the Shader manual is a good place to start.
The shader we will use is Star Nest by Pablo Andrioli (user “Kali” on Shadertoy). It is a purely procedural mathematical black magickery fragment shader that renders a really cool starfield effect.
Texture scrolling shader tutorial
Scrolling textures via shader is a staple in many shader effects. Let’s make one! Use the example project to follow along and try it out yourself. The method that will be used is UV offsetting using a constant in the shader.
There is also a demo of the example project on itch.io for those that would like to see the result of this short tutorial/guide:
Runner tutorial
In this tutorial we start with an empty project and build a complete runner game with an animated character, physics collision, pickups and scoring.
There is a lot to take in when learning a new game engine, so we have created this tutorial to get you started. It is a fairly complete tutorial that walks through how the engine and the editor works. We assume that you have some familiarity with programming.
Magic Link tutorial
This game is a variation on the classic matching game in the vein of Bejeweled and Candy Crush. The player drags and links blocks of the same color to remove them, but the objective of the game is not to remove long series of same colored blocks, clear the board or gather points, but to get a set of special “magic blocks” that are spread across the board to connect.
Building a car tutorial
If you are new to Defold, this guide will help you getting your bearings right in the editor. It also explains the basic ideas and the most common building blocks in Defold: Game objects, Collections, Scripts and Sprites.
We’re going to start from an empty project and work step by step to a very small, playable application. At the end you will hopefully have a feel for how Defold works and you will be ready to tackle a more extensive tutorial or dive right into the manuals.
Creating online games using Nakama and Defold
In this post we will look at how to create online multiplayer games in Defold using the open-source Nakama game server from Heroic Labs. Nakama is a feature packed game server with a clean API and excellent documentation. You can have Nakama up and running on your local machine in just a couple of minutes.
Releasing HTML5 games on Yandex.Games
Yandex.Games is a catalog of browser-based online games that can be played on smartphones or desktop devices and require no installation. Most games are also available offline (code for these games is added to the device cache during the first gaming session).
Releasing HTML5 games on Game Distribution
Game Distribution recently joined the Defold Foundation as a corporate partner. GameDistribution is the biggest broker of high quality, cross-platform games and their network serves over 300M users a month with top HTML5 content. As part of the partnership the foundation integrated the Game Distribution SDK as a Defold native extension and added a Defold template project to the Defold editor with the Game Distribution SDK integrated.
Shaders for Beginners
I had many problems understanding shaders, but after getting a grasp – it is so easy, convenient and powerful! I present to you my twisted version of understanding shaders, hoping it will help other aspiring devs 😉
This is my slow path from a total noob to a less-noob-ish shader programmer :smiley: It is meant for someone totally new, so don’t mind a plain style and many simplifications or depictions (not exactly totally true, because saying them totally true demands more explanations and those explanations demands more explanations and so on, and so on 😉 ) Later things will be clear for you and you will get to know easily how it is really working.
Grading tutorial
In this tutorial we are going to create a color grading full screen post effect. The basic rendering method used is widely applicable for various types of post effects like blur, trails, glow, color adjustments and so on.
It is assumed that you know your way around the Defold editor, and that you have basic understanding of GL shaders and the Defold rendering pipeline. If you need to read up on these subjects, check out our Shader manual and the Render manual.
Pixel Line Platformer
In this article, we go through the implementation of a basic tile-based 2D platformer in Defold. The mechanics we will learn are moving left/right, jumping and falling.
There are many different ways to go about creating a platformer. Rodrigo Monteiro has written an exhaustive analysis on the subject and more here.
Lights and Shadows
Example of how to achieve pixel perfect shadows in a 2D view. The sample is based on the following sources:
- 2D Pixel Perfect Shadows LIBGDX example: https://github.com/mattdesl/lwjgl-basics/wiki/2D-Pixel-Perfect-Shadows
- Adapted to Defold with technical discussion by d954mas: https://forum.defold.com/t/problem-with-shader/3808
- Final Defold sample project by Sayuris1: https://github.com/Sayuris1/2d_light_defold
Roids sample game
Welcome to the “Roids” sample game. This is a very simple “Asteroids” clone where you turn the ship left and right with the arrow keys and fire at incoming meteors
Linker sample game
Welcome to the linker sample game. Click and drag and link three or more fish of the same color together to remove them from the board. Long chains of fish yields boosters.
Shadertoy sample
This is a sample of a shader taken from Shadertoy and ported to Defold. The shader is a fragment shader called “Star Nest” that was created by Pablo Román Andrioli (username “Kali” on Shadertoy). You can find the original code here.
RPG map sample
This sample shows one method of creating very large RPG maps in Defold. The design is based on the following assumptions:
- The world is presented one screen at a time. This allows the game to naturally contain enemies and NPC characters within the boundaries of a single screen. The level designer has full control over how the world is presented on the player’s screen.
- The player character should be able to travel arbitrarily far without the game exhibiting floating point precision issues. These typically cause objects to flutter stangely when they move far from origin.
- The player’s movement is restricted by obstacles on the map, so the level designer can lead the player between screens using trees, rocks, water and other obstacles.
- It should be possible to mix and match tilemaps, sprites and other visual content.
Platformer Tutorial
In this article, we go through the implementation of a basic tile-based 2D platformer in Defold. The mechanics we will learn are moving left/right, jumping and falling.
There are many different ways to go about creating a platformer. Rodrigo Monteiro has written an exhaustive analysis on the subject and more here.
We highly recommend you read it if you are new to making platformers, as it contains plenty of valuable information. We will go into a bit more detail on a few of the methods described and how to implement them in Defold. Everything should however be easy to port to other platforms and languages (we use Lua in Defold).