Chapter 2. Let's Get These Snakes Out of This Book!

In this chapter, we will start making our first game with the LibGDX framework. We will make a little journey back to one of the very first popular mobile games, Snake. We will start out by looking at LibGDX's update cycle and how textures are handled. Then, we will dive into the world of game making by creating our Snake game!

The following will be covered in this chapter:

  • Why Snake?
  • The game update cycle
  • Introducing the snake
  • Making the snake move
  • Controlling the snake
  • Introducing the collision detection mechanism
  • Increasing the length of the snake once the apple is eaten

Why Snake?

Snake is one of the earliest mobile games that I can remember. I remember playing it many a time, chasing the apple while ...

Get LibGDX Game Development By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.