I MADE A GAME!!

Play this simple game I made using Unity and Microsoft Paint! 👑

Introduction

Hey Pirates! Today, I'm revealing the game I made for fun in July 2020. I'm also announcing the first-ever PIRATE KING channel event for a chance to win $100, so make sure to watch the video until the end. Although the game initially targeted Android and iOS devices, this re-release is only for the web. I'm warning you, though. Don't set your expectations too high; it's not a spectacular game. As I said earlier, I made it for fun. For now, let's go over the game rules.

COLORMAN

Alright. I titled the game COLORMAN after this guy. The goal is simple. The game has five colors: red, yellow, green, blue, and white. Colorman can only move in a straight line. Your job is to paint each tile to match the requirements above. For example, you must paint all eight tiles red on this level. Here, you must fill in fifteen red and fifteen blue. There's one catch, though. You need to finish coloring the tiles before your moves run out. For example, if you can't color all tiles yellow in fifteen moves, you fail and have to start the level over. Once you accomplish the requirements within the given number of moves, you move on to the next level.

Game Rules

Colorman Nodes

Cool. Let's talk about the nine different node types. The first in line is the tile node. A tile node forms the basis of the game; only Colorman can paint it with its current color. Next in line is the paint node. By passing through one, you can change Colorman's color. However, there are other ways to change its color and paint a tile. Two splash nodes, square and cross, can paint multiple tiles with a single move. For example, the square type splashes the paint to the current and all tiles surrounding it. And the cross type paints all tiles in four directions in straight lines until the wave hits an obstacle. But unlike the paint node, splash nodes are consumables and can only be used once. Wall and holes are the two obstacle nodes that hinder Colorman's movements. They cannot be colored and prevent splash nodes from spreading. A Warp node teleports you to the location of its color counterpart. An ice node will break if you step on it a maximum of three times. And it'll turn into a hole when it does. Lastly, you'll encounter a special level every ten levels, where you must break all the ice and reach the finish line.

Game Architecture

Now that we've covered the basic rules and components of the game, let me quickly share the implementation behind it - you know, the game architecture! After all, a game is an application of Computer Science concepts, right? I can't go over every detail in this video, but here's a high-level overview. Earlier, I explained the nine different node types and their roles. Each node type is a class, with each class inheriting the base, the Node class. Remember inheritance? 😉 All the shared functionalities of a node are defined in the parent, while those specific to a child are implemented in the children. For example, all nodes have types and coordinates, the x and y position of a node. Those are defined in the parent. What about the nodes that change Colorman's color? Only a few select nodes can do that. Those details are implemented in the children. Easy, right? 😉 Another excellent example of inheritance I applied in the game is what I named an Animatable Node. For example, the Ice node does not animate, so it inherits the Node class directly. However, the Cross node animates, so it inherits the AnimatableNode class, which inherits the Node class. What does the AnimatableNode class do? It inherits all properties of its parent while defining how the node should animate, such as the animation speed. What about the data structures and algorithms, everyone's favorite? 😉 Well, I used a 2D array of nodes to represent the game board and a hash map to store the mappings of all the warp nodes. That way, I can retrieve the data in constant time.

Tech Stack

Let's move on to the tech stack. For those interested, you can find the source code on my GitHub at piratekingdom.com/github. As I mentioned earlier, I used Unity to create the game. The Unity game engine supports C# and JavaScript. I chose C# because, well, I come from a Microsoft background, and I prefer a strongly and statically typed language. But that's it! That's all I used! There's no database, no server - just a game client. How do you save your progress? Good question! Your current level is the only data the game stores, so you don't need to set up a database. I save the level as an integer locally on the client. For the game's browser version, you can continue from where you left off as long as you use the same browser and do not clear the local storage.

Microsoft Paint

cross.png

splash.png

That's the tech stack. What about the art stack? Well, I'm not an artist; I don't even know how to use Adobe Photoshop. But I do know how to use Microsoft Paint! For example, these are the image files of an ice node using paint. This is the png file for the Splash node. Why is the latter rectangular and numerous instead of square and singular, like the ice node? Remember the "AnimatableNode" earlier? That's why. I programmed the node to show the next image in line, chunk by chunk. But this is done in a split second that it's deceiving your eyes and brain to appear as if the node is "animating." Think of a movie. You're not actually watching something moving on the screen. What you are watching really is a series of still photographs in rapid succession. Anyways, back to the game, although I created most of the game assets, my friend helped me with the images of Colorman. I asked her to create a main character that suits the art style - or the Microsoft Paint style - and she came up with this. Genius. 🤔 For the game icons and background images, I downloaded them for free from a game asset store.

player.png

player_dead.png

Behind the Scenes

Let me quickly talk about the motivation behind making this game. As I mentioned at the start of the video, I first released the game for mobile on July 2020. If you remember, there was a lockdown in the US from March to July of that year due to the pandemic. I took advantage of the situation to study Unity and game development because, well, I had nothing else to do anyway. 🤷 I think it took me about three months to complete the game from scratch. But this was my first time using Unity Engine, and I worked on it while working full-time at Microsoft. If I were to do it again, I could probably do it in a month. 🤷

Play Now

Cool. You can play the game on my website here. And while you are at it, look around my website for coding-related resources and some nice deals. For example, I created free coding and web development curriculums for beginners interested in coding. If you are more serious, you can get a $1,000 discount for any Springboard bootcamps using the promo code PIRATEKING. If you're graduating soon or are already a professional looking to accelerate your career, consider Pathrise's professional support and mentorship with no upfront cost until you get hired. Having worked as a mentor for both Springboard and Pathrise for over a year, I can attest to how outstanding their programs are. Visit deals for more details.

PIRATE KING EVENT

Let's move on to the fun part, PIRATE KING's first-ever channel event! It's simple. I'm giving away $100 to the first person to reach level 100 in the game. This is how it works.

  1. Get to level 100

  2. Take a screenshot

  3. Post it on the #colorman channel of my Discord server

You can also find the event rules in the video descriptions and comments. Please, follow the instructions carefully to win the prize; only the screenshot in the colorman channel will be accepted. Lastly, play on PC for the best experience, not your phone. I know. I originally made it for mobile. But releasing an app on Apple's App Store and Google's Play Store is such a painful process that I decided not to do it this time. Again, I made it for fun anyways.

That's it for today. Let me know what you think in the comments below. Come visit my website to play. Or follow the link below. Like. Subscribe. Play. I'll see you guys next time. Bye.

 
Previous
Previous

Is LeetCode Relevant?

Next
Next

ChatGPT Explained - THE END OF SOFTWARE ENGINEERS