Game code was written in Visual Studio (check the free Community edition here). For debugging purposes, don’t forget to check the Visual Studio tools for Unity here.

So, let’s start with the small tutorial! This game’s development has many aspects, we’ll attempt to touch all of them one by one. First of all, we used Unity’s spritesheet editor to “slice” the spritesheet and get references to specific sprites

Then, we created a small animation to simulate the flight course of the bird (this can be easily accomplished if you drag-drop the relevant sprites into the scene).

Now, let’s take a more detailed look at our scene. We have various objects made children of our perspective camera and the Flappy bird.

I had blogged in the past about a simple puzzle game in XNA. Nothing better than to recreate it in Unity with a tutorial, of course! To begin with, here’s a screenshot of the game running on the editor

To begin with, we’ll need a photo. The best way to save yourself from copyright issues and not having to read licenses etc is to use a photo that you took! So, we need to slice it. For this purpose, we’ll use Unity’s native 2D tools and its sprite editor.

Once we set the sprite mode to multiple, we can use the sprite editor to ‘slice’ our image. Since the image does not have an alpha channel, we’ll use Grid slicing. Moreover, we’ll name our exported sprites with a name that contains their location information (i.e. piece-0-0 => this implies that the sprite’s “correct” location is on the top left corner of our game). Plus, we’ll set each sprite’s pivot point to be top left, since this will help us in positioning.

This tutorial is meant for educational purposes only to showcase how to build certain types of games. Please respect the copyrights/trademarks of others!

Some time ago I did a blog post about a brick game (like Arkanoid) and its adaptation to Windows Phone using XNA. Couple of weeks ago, I attempted to recreate it from scratch using the Unity game engine and, to no surprise, it was pretty a piece of cake. Below you can see a screenshot from the start screen of the game.

About 4 years ago I had blogged about the creation of the classic Bubble Breaker game in XNA. Since I’ve recently started to get acquainted with the Unity3D game engine, one of the first things that crossed my mind was to try and recreate it using Unity. Why did I choose Unity? Well, one of the reasons is that it supports my favorite programming language C# plus games can be exported to my favorite platform, Windows Phone. Conversion from XNA was not that straightforward (well, I expected that, to be honest) in the matter that only the search and compare algorithms managed to survive. Game code was written in Visual Studio (check the free Community edition here). For debugging purposes, don’t forget to check the Visual Studio tools for Unity here.

Game implementation is pretty basic, it contains 3 screens. First, we have the intro screen where you can select either to play the game or view the top 10 scores. Then, there is the main game screen (we’re making a game after all!). All screens have a script to dynamically change the background color. Purpose of the game is to remove all (or at least most of) the bubbles in the game by tapping. Once the user taps on a bubble, the neighboring ones (vertically and horizontally) will be marked for removal. On a second tap to one of the marked bubbles, they will disappear and the ones above these will fall due to gravity. Moreover, game tends to push the bubbles onto the right of the screen, so as not to have an empty column during the course of our game. Check out some screenshots from the game running inside Unity Editor.

Main screen contains some simple Unity GUI buttons in which we can navigate to game and high scores screens, plus a simple checkbox to activate/deactivate sounds (I got that feedback from the single beta tester – that’s me!).

On the game screen, each bubble is a rigidbody (that’s Unity way of saying that each bubble obeys the laws of gravity). We keep track of the positions of all bubbles in a 2D array and we initialize each and every one using a random color, dynamically pulled from the ResourcesMaterials folder (yeah, this could have been done in an easier way but I just wanted to experiment with dynamically loading stuff without providing them as fields/parameters to the script).