Skip to main content

Posts

Showing posts with the label how to develop a app in kotlin
 

How to make a 2D Game in Android Studio Using Koltin 003

How to make a 2D Game in Android Studio Using Koltin 003  Hi Guys, So, we have completed the "Game Loop" and we have successfully created a rectangle in our screen. Now in this article, we will describe our obstacles size, width, height, and the gap from where our player can pass. And In the next article, we will draw obstacles on the screen. If you have not read, previous articles yet, then click here . So, Let's get started with our tutorial. Create an Object Create an object and Name it "Constants" In the constants object, we will store the screen height, screen width, and the context, init time of the game. Copy below codes and paste it into your constants object. 1 2 3 4 5 6 7 object Constants { var SCREEN_WIDTH:Int = 0 var SCREEN_HEIGHT:Int = 0 var CURRENT_CONTEXT: Context? = null var INIT_TIME:Long = 0 } Now, describe the screen width and screen height in the main activity. Just copy the b...

How to Create a Color Changing Sensor Game in Android Studio with Kotlin

Hello World, Many of us acknowledge about Sensors. Sensors are very significant parts of our Smartphone. There are many types of Sensors. In this article, we will learn " how to create a color changing sensor game in the android studio with kotlin " support. Lets Learn About Sensors There are many types of sensors in our smartphone. We can build different types of application with the sensors. For now, we will use the accelerometer. The accelerometer measures the acceleration force in the form of m/sq. And it applies three physical axes(x,y,z) into the device. Its also measure the force of gravity. When we shake or tilt the phone, its detect the motion. If you have studied coordinate in high school, you can easily understand the accelerometer and another sensor as well. Create a new Android Studio project  Create a new project in Android Studio Name it "Sensor Game". Tick Kotlin support, in your project. Then choose an empty activ...