Getting started with the Snake game
To get started, make a new project called Snake
. This time, we will use the Empty Activity template as we will not be creating any UI whatsoever.
- Rename the Activity Name to
SnakeActivity
. - Uncheck the Generate Layout File option—we do not want a layout generated as we will be laying out every pixel ourselves.
- Uncheck Backwards Compatibility (AppCompat)—we won't need it for our game and it will still run on almost every phone and tablet. We will be working with the plain vanilla
Activity
class in this final project.
Note
All the code and assets for this project are in the Chapter 28
folder of the download bundle. Note that for this project, the completed game, as it will be by completing the steps up to the end of Chapter 29, Enumerations and Finishing the Snake Game, is in the Chapter 28
folder. There is no separate code bundle for Chapter 29, Enumerations and Finishing the Snake Game.
Now, we will take an additional step to stop the screen...