Chapter 4. Finishing the crab game

topics:

world initialization, setting images, animating images

concepts:

constructors, state, instance variables (fields), assignment, new (creating objects programmatically)

In this chapter, we will finish the crab game. “Finish” here means that this is where we stop discussing this project in this book. Of course, a game is never finished—you can always think of more improvements that you can add. We will suggest some ideas at the end of this chapter. First, however, we will discuss a number of improvements in detail.

Adding objects automatically

We are now getting close to having a playable little game. However, a few more things need to be done. The first problem that should be addressed is the fact that we always ...

Get Introduction to Programming with Greenfoot: Object–Oriented Programming in Java™ with Games and Simulations, First Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.