“Tipsy Tower” prototype made with Unity and C#

If you enjoyed the Tipsy Tower prototype made with Construct here I am with the Unity version, powered with the free platformer art tileset provided by Game Art 2D

Let’s start from the result, here’s what I built:

Click to drop the crate.

Now it’s time to have a look at my Unity scene:

Let me explain the assets, one by one:

Crate image: the PNG image of the crate.

Ground image: the PNG image of the ground.

Ground: it’s just “ground image” placed into the game with a Rigidbody 2D component at its default settings (ececpt Body type: Static) and a Box Collider 2D component at its default settings.

Moving Crate prefab: it’s the prefab of the moving crate, which includes the crate image and the moving crate script.

Moving Crate: the “moving crate prefab” placed into the game

Physics crate prefab: it’s the prefab of the physics crate, which includes the crate image and the physics crate script. It has a Rigidbody 2D component at its default settings and a Box Collider 2D component at its default settings.

Now, let’s have a look at the scripts, the core of the game. The first one is the physics crate script, which only removes the crate from the game when it’s not longer on the stage.

crateScript.cs

Now, the moving crate script, which is only a non phyiscs driven crate moving from left to right:

movingCrateScript.cs

The main script waits for player input, handles physics crate creation and hides the moving crate.

MainScript.cs

And despite there was some code to write, it was easy and fun to make the prototype. Next time I will show you how to do it with Phaser, then we’ll improve the prototype to check for the highest crate, meanwhile download the Unity project.

  • Marc GA

    Use the Canvas Group component to change alpha.