Hey Hive
As a developer, I really like challenges.
I’ve always loved when a client comes up with a new idea I’ve never tried before or when I see something on social media that grabs my attention and inspires something new.
Although I tend to focus more on game development, it has led me to explore many different areas of programming: frontend, backend, game dev, and different languages, as well as creating games in various environments like Unity, Discord, and HTML5.
That’s why I currently love working with one of my freelance clients, for whom I develop games for brand events and activations. Because they are always looking to innovate with cool ideas.
In this post, I wanted to share with you a project I made last month with them.
The idea was a 2D maze game for Android in which players had to complete the maze with their finger within a set time.
It sounds simple at first, but developing what seemed like a straightforward mechanic turned out to be more challenging than expected. Mainly because they wanted to use a flat image of a maze.
Something like this:
My first thought was to add colliders to every single wall of the maze, but that would have been tedious. And if the maze changed for any reason, I’d have to adjust all those colliders again.
I did some research, but I couldn’t find the right tutorial. Most examples used simple mazes made from 2D rectangle colliders where you move a player object. Not what I needed.
So… I finally asked ChatGPT.
Not gonna lie. As a programmer, ChatGPT has become an everyday tool for me. It speeds up my development and is a great research companion in cases like this. (TIP: Use it to learn, not to depend 100% of it. I always make sure to understand the proposed solution instead of copy-pasting blindly.)
It suggested a great approach:
-
The maze walls are all one color.
-
The background is either transparent or white.
-
While the player moves their finger, I read the pixel color data at that position.
-
If the color changes abruptly, it means the player hit a wall.
And it worked perfectly!
I also used Unity’s Line Renderer to draw the player’s path so it seems your are using a pencil.
Here is a quick gameplay!
Of course, that wasn’t the end of it. I also had to:
-
Detect if the player starts exactly at the start position (and not anywhere else).
-
Detect when they reach the finish.
-
Add checkpoints, because the game was designed for kids—and restarting from scratch after every small mistake would be frustrating.
Thankfully, I solved all of these using the same logic:
I placed invisible empty GameObjects that Unity detects when touched, marking the start, finish, and checkpoints.
This wasn’t an easy development, but I’m really proud of the result and learned a lot from the process.
That’s all for today!
If you enjoyed this post and want to see more upcoming projects, make sure to follow me. Thanks for reading!