Going to the Moon

Teaching Computer Programming the Fun Way


This Greenfoot-based scenario was developed by Randy Gallant as part of his senior capstone project under the supervision of Dr. Qusay H. Mahmoud at the University of Guelph-Humber. The aim of the project was to develop a new concept for teaching introductory Java programming that includes inter-related labs and a capstone project utilizing the Greenfoot environment (developed by the same group who developed BlueJ). The concept behind the Going to the Moon scenario is designed to improve the students experience in their first computer programming course by making learning fun and entertaining, and the end result would be renewed interest in CS majors and the computing field in general. Randy has many years of teaching experience at Humber College (where he is still teaching) who decided to come back to school to finish a CS degree.

Greenfoot and Going to the Moon

The Greenfoot environment makes the creation of graphics and interaction easy. Students can concentrate on the application logic, and engage and experiment with objects. Applications in Greenfoot are called scenarios, and the environment enables students to run these scenarios, make modifications, and re-run the scenarios where they would be able to see the effect of the changes they have made right away.

Going to the Moon is a Greenfoot scenario that we have designed and developed to provide educators with a better way to teach the fundamentals of computer programming using Java and the Greenfoot environment. The scenario is broken into 10 labs and a capstone project. During the time that students spend in the lab they will be learning the basics of Greenfoot and the Java programming language. The basics skills that the students will develop will all come together in a final programming project for the students to complete near the end of the semester. The secret plan behind this is to give students an opportunity to learn the basic skills of programming without them realizing that they are learning.

The Going to the Moon scenario is based around a computer version of a space vessel traveling to the Moon and returning to Earth again. Along the way the space vessel will encounter asteroids and space junk which the student's program will have to identify and maneuver around. Fuel is also an issue that the students have to take into account. When they leave Earth they will not have enough fuel to get to the Moon, so a refueling stop at a space station will have to be factored into the trip. The space vessel will be equipped with missiles to destroy asteroids and space junk if there is not enough fuel to negotiate around. Students must keep track of their arms and only use them as a last resort. With all of the moving around in open space the studentís program must be able to keep track of where the vessel is in space at all times and constantly maneuver itself back on to the path to the Moonís landing point. Here is what the full scenario looks like:

Obviously the goal of the program is to make it to the Moon and then back home for the party and happy ending. This will not always be the case. Unlike the Apollo 13 mission there will be no second chance for these space travelers. :-) The space vessel that the students will be using in their program will destroy itself if their program makes a tragic error. Some of the situations that will cause the destruction of the space vessel are as follows: Hitting an asteroid or some space junk, running out of fuel, missing the landing spot on the Moon or Earth, destroying the Moon or Earth with missile weapons or crashing into the Moon or the Earth during landing maneuvers. All of these situations must be avoided or the mission will be a failure.

The Labs

As in almost any practical based learning situation lab experiments play a big role in the learning of the topics of the course. In this case there is no difference. The Going to the Moon scenario includes 10 labs. A different set of experiments and learning activities will take place in each lab period. The culmination of the 10 lab sessions will be the programming knowledge and skills to tackle the capstone project near the end of the semester. The weekly lab sessions are be designed in a way that the student will develop various skills that will be utilized in the project, without giving the solution directly to them. In other words the concepts they learn will translate to the project but not the exact code. Therefore, the students must still have to think about how to use the learned concepts to implement the project solution. Every lab has a starting scenario with particular goals in mind. For example, Lab 4 teaches the students how to detect space objects in their path and navigate around them. Here is what the starting scenario for Lab 4 look like.

Presentations and Publications

The Going to the Moon scenario has been presented at and published in the following venues:


To give you an idea of what the finished capstone project of the Going to the Moon scenario look like in action, we have bundled the scenario as a Java Applet. This is a large applet (approx. 1.4MB) so it may take some time to load. Once it is loaded in your browser, click the Run button to run the scenario. Click here to start the demo Applet. This is about the fun of learning and not decompiling!


Following the presentation at the Greenfoot Day at ACM SIGCSE 2008, several requests have been received asking for copies of the scenario from Computer Science teachers at universities, colleges, and high schools. We thank you for your interest, and we are pleased to offer the scenario for free download. The scenario is bundled in a ZIP file that includes: the 10 labs, the sub-scenarios, and the final capstone scenario. Please register to download the ZIP file.


We do have working solutions for the labs and the final capstone scenario, and we'd be happy to provide them to teachers who would like to use the scenario in their teaching. We kindly ask that you (or your students) do not post the solutions on public websites. To request a copy of the solutions, please send an email to: Randy Gallant (Randy.Gallant[AT]humber.ca) or Qusay H. Mahmoud (qmahmoud[AT]uoguelph.ca). Please include information (e.g. school's webpage with your name on it) to convince us that you are a teacher. :-)

Users Feedback

We'd love to hear about your experience with this scenario, so please email us your (and your students) experiences. Here is one testimony from a Grade 12 co-op student who has worked through the scenario:

My name is Wei Cui, I'm a Grade 12 student at Centennial CVI in Guelph. I got involved with this project because my Co-op placement at the Department of Computing and Information Science at the University of Guelph allowed me to try out this amazingly easy and visual way of practicing programming in Java.

When I was first shown the final project and what is needed to done for it, I was intimidated by the complexity. However, as I worked through the scenarios I found that each scenario teaches an important programming concept and part of the final project. The gradual building of the pieces helped me understand how the final project worked and made it much easier to program. The scenarios enforced a lot of the concepts I learned in my Grade 12 programming class but in a visual and easy learning environment. This would be a great tool for teaching and getting students involved in beginner programming.

In the scenarios, I found that programming each method correctly was sometimes a challenge because I was not familiar with the class. But through careful reading and understanding of the other parts of the class, I was able to complete each scenario. I think the scenarios are a great way of practicing many skills that are wanted in programming but in a way that appeals to even the younger students.

From completing all the scenarios, I found that it is a much more involving and interesting way of learning programming than how I was taught in my Grade 12 programming class.

Contact Us
Your comments and suggestions are welcome. Please send your comments by email: Randy Gallant (Randy.Gallant[AT]humber.ca) or Qusay H. Mahmoud (qmahmoud[AT]uoguelph.ca)

This page is maintained by Qusay H. Mahmoud (
qmahmoud[AT]uoguelph.ca). Last modified March 2008.