Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(1 edit)

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.

(1 edit)

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.