Summary

The Snake game is taking shape. We now have an apple that spawns ready to be eaten although we have nothing to eat it yet. We have also learned about ArrayList and how to use it with the enhanced for loop and we have also seen the Java enum keyword and how it is useful for defining a range of values along with a new type. We have also strongly hinted that we will use an enum to keep track of which direction the snake is currently moving.

In the next chapter, we will code the Snake class including using ArrayList and enum to finish the Snake game.

Get Learning Java by Building Android Games - Second Edition 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.