446 Aniyah Squares Apt. 388 Bednarland, HI 70655

How to quickly write an Android game in Unity

Unity

Nowadays, anyone can become a successful mobile game or application developer without a titanic effort. An example of such a case is Dong Nguyen, who developed Flappy Bird. The game did not have any complex mechanics or graphics, but that did not stop it from becoming popular and bringing its creator fifty thousand dollars a day. However, there was nothing remarkable about the game. All it took to be successful was being in the right place at the right time and a little luck. This can happen today, you just need the right idea.

To demonstrate how easy it is to write something like this, today we’ll write our own Flappy Bird using Unity in just 10 minutes.

Playable character

First create a new project and make sure 2D is selected.

Load your bird sprite into the scene. Don’t forget to turn on your fantasy!

Then adjust the size of the sprite as you like by dragging it around the corner in the desired direction. The sprite should be visible in the hierarchy window on the left. All objects in the scene are visible in it, and at the moment there should be only two of them: a camera and a bird.

Drag the camera onto the bird and release. The camera should be under the bird, which means that the camera is now the “child” of the bird. Now the position of the camera will be fixed relative to the bird. If the bird moves forward, the camera does the same.

Select the bird again in the scene or in the hierarchy window. You will see a list of options and attributes on the right in a window called Inspector. Here you can manage various variables associated with a specific object.

Now click on Add Component. Choose Physics2D> Rigidbody2D – this is a ready-made set of instructions for applying gravity to our character. Click on Constraints in this panel and then select freeze rotation Z. This will prevent the bird and camera from rotating in a circle.

In the same way, add a Polygon Collider that tells Unity where the character’s boundaries are. Press Play and see how the sprite, along with the camera, falls down infinitely.

Related Post