The classic Tangrams puzzle game using stained glass tans.

Backdrops are historic Chinese art from as far back as the 17th century. I was inspired to use them because Tangrams originate in China. However, most of the artwork actually predates Tangrams puzzles, which didn't appear until the early 19th century.

Complete source code for this game is available on Github. Feel free to fork and contribute, or even make your own version of the game!


This game is an early pre-release. Feedback is welcome! Let me know what you think in the comments below.

More information

Published 1 year ago
StatusPrototype
PlatformsWindows, macOS, Linux, HTML5
AuthorGeekyTime
GenrePuzzle

Download

Download NowName your own price

Click download now to get access to the following files:

StainedGlassTangrams.app.zip 48 MB
StainedGlassTangrams-linux.zip 38 MB
StainedGlassTangrams-win32.zip 34 MB
StainedGlassTangrams-win64.zip 27 MB

Comments

Log in with your itch.io account to leave a comment.

(Edited 1 time)

Hi Chris, So I downloaded your tangram project and i love it, and i want to learn how to create games especially tangrams, however my issue is that there is no such tutorials online.
My other issue is that i have looked into the project but i dont really understand where the levels are being loaded. Is there a video that you posted that I can check out on the process?

I greatly appreciate your help

What i dont understand is how are the shapes place and how is the outline placed as well ?

The shapes are gameObjects with physics bodies and colliders attached to them. I'm using the built-in 2D physics engine in Unity. The physics components are attached to the GameObjects in the Unity GUI, and then controlled by the Piece and PieceSet behaviors.

> Is there a video that you posted that I can check out on the process?

There are lots of pretty good tutorials available directly from Unity. I'd start with videos from their 2D Game Creation series.

> My other issue is that i have looked into the project but i dont really understand where the levels are being loaded.

The levels are saved as Unity "prefabs", in the Puzzles folder. The puzzles are all referenced by the TangramsSupervisor, and then added and removed from the game scene based on user actions.

(Edited 1 time)

Hi Chris, thank you for your help,
One question, hopefully the last, how does unity recognize that this is the right shape ? and how can i make it less sensitive to the probability that its the right one.
because right now i have to move it by the mil to get the star fade
Also how do i create a line renderers for different polygon colliders (tangrams) I see the prefab positioning but I dont know how to create a custom one.

I used Unity's physics engine for collision detection. Each of the tans/pieces has a polygon collider attached to it. When all of the vertices for the colliders of the pieces are inside the collider for the puzzle, I know that the pieces are all inside the puzzle, and the puzzle has been solved.

The pieces were drawn in a program for MacOS called AffinityDesigner. I use it to make vector graphics for most of my games.

The puzzle is drawn by the PolygonRenderer class. If you attach a PolygonRenderer to a gameobject that also has a PolygonCollider, the renderer will find the collider, and loop through the vertices on the collider to draw the shape. It uses the scripting interface for the Unity LineRenderer component to create the lines.

Amazing artwork! Love the game and thanks a ton for the source code! You just made my day! :D