A.I, Data and Software Engineering

Search results forkotlin

Smooth nature snake – game redev with Kotlin (part 3)

In part 2, I introduced how to make the serpentine movement. We continue this article by covering the turning mechanism for the snake. Challenges in turning animation Fig 2: Classic snake game design with blocks and grids As we want our snake looks as smooth as possible, the two challenges are: Firstly, the head should slowly change to the target direction rather than a sudden turn. As the head...

Smooth nature snake – game re-dev with Kotlin (part 2)

This is the second part of creating a smooth nature snake game. You can read the first part here. In this part, we will cover the challenges in simulating the snake’s movement pattern. How snakes move Snakes move in zigzag patterns as demonstrated in the following figure. Smooth nature snake movement patterns We can see that the whole body of the snake forms a shape that is similar to the...

Smooth nature snake game – re-dev with Kotlin (part 1)

When my students proposed a snake game for their projects, I thought it is kind of boring. They are all the same old ideas. Nevertheless, how you want it to be do matter as the game mechanics and animations can be much varied. snake game Why I redev the snake game? Did I try to reinvent the wheel – Not quite! What I include in this post addresses several challenges to simulate a fully...

How to create Static Members for a Kotlin class

petamind

Kotlin programming language Most of the programming language have concepts where classes can have static members. Namely — fields that are only created once per class and can be accessed without an instance of their containing class. Kotlin doesn’t support static keyword. It means that you can’t create a static method and static variable in Kotlin class. Fortunately, Kotlin object can handle this...

An Introduction to Kotlin

Kotlin logo Ever since Apple released the Swift programming language for iOS, lots of Android developers have wanted a similar language for Android development. If you are one of those developers, you are going to love Kotlin, a JVM language that is remarkably similar to Swift. Kotlin is a statically-typed language, developed by JetBrains, whose syntax is more expressive and concise than that of...

A.I, Data and Software Engineering

PetaMinds focuses on developing the coolest topics in data science, A.I, and programming, and make them so digestible for everyone to learn and create amazing applications in a short time.

Categories