- Home /
Grid creation for 2D train track puzzle game
Hi guys, I'm hoping to make a 2D train puzzle game similar to Rail Maze and Gold Rush which are available on the App Store and Android Store.
I am unsure as to how the grid should be created. Is it possible to actually create and display the grid using C# or will the grid have to be created manually by placing sprites together? If it is possible to create and display the grid using C#, how would I be able to do that?
At the moment, I only wish to have a pre-defined track for the level and the player will have to rotate pieces of the track to complete it. Once I get this part nailed down, I hope to allow the player to build and complete their own track by allowing them to drag and drop track pieces onto the grid.
Any help at all would be welcome.
Thanks!
Unity Answers focuses on single, specific technical questions. Design questions like this one are best asked on Unity Forums. There format fits design questions better.
The games you mention likely have a single rectangular mesh with a quad for each square that can be rotated. A texture atlas and the uv coordinates assigned to each quad deter$$anonymous$$es what is displayed in each quad. So assigning a square a specific graphic to display is a matter of picking the right part of the texture atlas to assign to that square. The animation of the rotation of a piece is likely done with a sprite/quad as a separate game object, but that sprite would be hidden after the rotation. Note that this approach is likely the right approach (especially for mobile), but what I've outlined here is not a simple thing for a beginning Unity programmer.