Create a Jigsaw Puzzle Game in Unity

By Shamim Akhtar 2 min read

Contact me

In this tutorial, we will go in-depth and learn how to make a jigsaw puzzle game using C# in Unity. 

We will start the tutorial with the basics of the Bézier curve, followed by implementing Bézier curves in Unity. We will then move on to creating jigsaw tiles from an existing image using the Bézier curve, generate a jigsaw board from an image, and finally create the jigsaw game in Unity. 

Learning Objectives

By the end of this tutorial, you will be able to

  1. understand the theory and maths behind Bézier curves;
  2. implement Bézier curves programmatically and visually within the Unity;
  3. apply Bézier curves to cut an image;
  4. implement flood fill algorithm to fill pixels within an area defined by Bézier curves;
  5. create jigsaw tiles from images using Bézier curves;
  6. apply what you learned above to create a jigsaw puzzle game in Unity;

You will also 

  1. develop problem-solving skills through troubleshooting and debugging potential issues encountered during development; and
  2. gain confidence using C# programming concepts within Unity.

Download the assets needed for this tutorial from https://faramira.com/downloads/jigsaw/assets_to_dowmload.zip.

Play the finished game

Click Play to start a puzzle. When you finish, click Play again for a harder one with more tiles.

Loads about 40 MB and works best on a computer. See the tutorial page on GitHub

You can find the entire source code of this project in the GitHub repo. https://github.com/shamim-akhtar/jigsaw-puzzle/tree/main

View the Tutorial on YouTube

Create a Jigsaw Puzzle Game in Unity

The tutorial is divided into four broad sections, with each containing one or more subsections. 

You can read these sections as a continuous post divided into pages.

Search Faramira