
Well, that ended the month of evening-night coding, the result of which was another toy for Android. Still, programming is a fascinating activity when you create your own world, write the rules of this world. Yes, so that there are no illusions - the toy is very simple - the good old Snake.
Why did you want to write? Now I don’t remember, just probably the idea came, and the brain took hold of it, and did not let go until the idea became a more or less complete form of the toy.
Here are some screenshots:



Of the interesting things, the snake itself is controlled using an accelerometer (it is necessary to tilt the phone so that the snake changes direction), and besides hares there are also carrots, lemon, mushrooms, frogs, chicken and other objects.
')
The game has 15 levels so far, but I think in the end there will be 50 levels, although maybe more, this is how much patience there is enough.
In order to satisfy their own ambitions, put a toy on the Play the Google:
play.google.com/store/apps/details?id=ru.crazyprojects.android.snake#?t=W251bGwsMSwxLDIxMiwicnUuY3Jhenlwcm9qZWN0cy5hbmRyb2lkLnNuYWtlIl0 . but not very effective yet.
What was interesting in the development, perhaps it is working with an accelerometer, and of course, inventing objects and levels of the game.
As it turned out, not all accelerometers work in the same way, that is, not on all devices, the accelerometer gives the corresponding value when the device is tilted, so on some devices, for example, up-to-left or up-down movements (i.e., tilt the device upward, and the snake is crawling to the left). But I think this is a topic for a separate article, but at the moment I am working around this unfortunate fact.
PS For lovers of digging, you can download the
source.