New components introduced

Collection Tile source - how to use spritesheets instead of an atlas to store assets for building 2D maps.
Collection proxy Tilemap - how to build level data using a tile source and manipulate it as a 2D array.
Library Library - how to include dependencies and libraries.

Worm | Step-by-step tutorial

Screenshot

The classic game of 'Snake' with a two to four player twist. Can you eat the most fruit and be the last worm alive?

In this tutorial we introduce the concept of spritesheets as a memory efficient store of level data for games that require the player to navigate a 2D map or static platforms. Learn how to store spritesheets in a tilesource and then create a game level using a tilemap from the tilesource. This tutorial assumes you already have a knowledge of building games in Defold including input bindings, game objects and scripts. If not, you should attempt the previous tutorials first.

This tutorial has sufficient complexity to be a programming project for OCR A level Computer Science, and comfortably a group B project for AQA A level Computer Science.

What you learned in this tutorial

  1. A tile source holds equally sized bitmaps (tiles) that allow you to construct graphics for top-down levels and platform games easily.
  2. A tile map uses the graphics in a tile source to construct a level either at design or run-time.
  3. Each image in the tile source has a unique number that is applied to the tile map when a tile is placed. The tile map is a large 2D array storing the value of the tile placed in that position which you can manipulate using script code.
  4. Higher-order data structures such as queues can be used to track objects that are made of many parts.
  5. Libraries extend the functionality of a programming language by including code in your project that other people have written.