Tag Archives: androidtutorial

Flappy Bird – Scoring

In the very last lecture of the Flappy Bird tutorial we learned how to add to game the collision detection. When the circle of the bird overlap the rectangels of the pipes, then we are going to get a log message in the Logcat of the Android Studio.

In this lecture we are going to learn how to add the scoring to the Flappy Bird game. It means the score has to be even higher when our bird could fly through the gap of the pipes.

Continue reading Flappy Bird – Scoring

Follow and like us:

Flappy Bird – Collision Detection

In the previous lectures in our Flappy Bird tutorial series we have learned how to have a flying bird, the gravity, and in the very last lecture we have added the left moving pipes.

In the next part we are going to add the collision detection. The collision detection is a very important part of the Flappy Bird app. If we can drive the bird between the pipes, then we are going to get 1 point, but if we can’t, then we will lose the game. It means, thet our bird collided with the pipes. At the of this lecture we will have this collision detection πŸ™‚

Continue reading Flappy Bird – Collision Detection

Follow and like us:

Functions

Every Kotlin program has at least one function main(). However, you can define any number of functions in your program until memory is not full. It’s always a good practice to divide the whole program into smaller functions that are logically similar. It makes program more readable, understandable and debuggable.

A function declaration is done using the fun keyword.

The basic syntax of a function in Kotlin looks like this:


Syntax of for loop

Continue reading Functions

Follow and like us:

Array of Kotlin

An Array is a collection of a values of the same type. When you need to store a list of values, such as numbers, you can store them in an array, insted of declaring separate variables for each number.

Constructor of Array in Kotlin


Syntax of Array in Kotlin

As you can see, constructor of array takes a fix size and an init function to return elements of array. There are multiple ways to create a kotlin array

      • Using Library function
      • Using Array Constructor
      • Using Factory function

Continue reading Array of Kotlin

Follow and like us:

Measure Your Distance on Map

In this tutorial we will learn how to implement Google Maps in our application, how to measure the distance and how to visualize it on the map.

With the Maps SDK for Android, we can add maps based on Google Maps data to our application.

Continue reading Measure Your Distance on Map

Follow and like us: