Book Image

Creative Greenfoot: RAW

By : Michael Haungs
Book Image

Creative Greenfoot: RAW

By: Michael Haungs

Overview of this book

Table of Contents (17 chapters)
Creative Greenfoot
About the Author
About the Reviewers

The Avoider Game tutorial

This tutorial is heavily based on AS3 Avoider Game Tutorial by Michael James Williams ( In that tutorial, you build a game that creates smiley-faced enemies that rain down from the top of the screen. The goal for the player is to avoid these enemies. The longer you avoid them, the higher your score. We will build the same game in Greenfoot, instead of Flash and ActionScript. As with Michael James Williams' tutorial, we will start small and slowly layer on functionality. We will pause frequently to consider best practices and good programming practice. Enjoy these learning opportunities!

We will first build the basic components of the Avoider game, including the initial scenario, the game environment, the enemies, and the hero. Then, we will layer on additional functionality, such as scoring, introduction and game-over screens, and the notion of levels.

As mentioned in the preface, we'll assume you have downloaded Greenfoot and have it installed. If you still haven't, do so now. Go to for easy-to-follow instructions on downloading and installing Greenfoot. While you are there, make sure you are minimally familiar with all the tutorials provided on