Build Snake with Zircon and Kotlin Part 3

Previous tutorial: Part 2 At this part of the tutorial we want to create a real snake and let it eat some cherries. To archieve this we have to: Keep track of the snake tiles Add a cherry tile on a random position Check the cherry tile against the head of the snake and increment the snake length if they match Forming a tail The main change in this step is to update the GameController class.
Read more...

Build Snake with Zircon and Kotlin Part 2

Previous tutorial: Part 1 At this part of the tutorial we want to make the square move on keyboard inputs. To archieve this we have to: add a listener for keyboard events move the square depending of the direction track the position of the snake and update it accordingly cleanup the old position Receiving input At first we need to define a direction interface. It contains the directions UP, DOWN, LEFT, RIGHT.
Read more...

Build Snake with Zircon and Kotlin Part 1

This tutorial will show you the basic usage of the OpenSource library Zircon. Setting up For this tutorial we will use gradle to build the application. But instead of groovy we will use the kotlin gradle dsl. mkdir kotlin_zircon cd kotlin_zircon gradle init --dsl kotlin All Scripts used in this tutorial are tested with PowerShell under Windows 10 but they should work fine in any posix compliant shell too.
Read more...