Game programming with Greenfoot

Document Sample
Game programming with Greenfoot Powered By Docstoc
                                                                             Web site:
                                                                         Developed at: University of Kent
                                                                                     and Deakin University
                                                              Further Information:

    Game programming with Greenfoot
    Greenfoot is a programming environment for schools and introductory university courses.
    Greenfoot supports the Java Programming Language, so students learn standard object-           • Quick start into programming

    oriented programming in Java. The environment is designed specifically to convey object-        • Standard Java programming language

    oriented concepts and principles in a clean, easily accessible manner.                         • Highly graphical and interactive
                                                                                                   • Cross platform
    The Greenfoot environment makes creation of graphics and interaction easy. Students can        • Flexible scenarios
    concentrate on modifying the application logic, and engage and experiment with objects.        • Modify existing scenarios, or write
    Developing simulations and interactive games becomes easy, and feedback is immediate.            your own
                                                                                                   • Strong emphasis on teaching and
    The environment is designed to quickly engage students who may have no prior interest
                                                                                                     learning object orientation
    or experience in programming. Achieving simple animation results is quick; sophisticated,
                                                                                                   • Built-in editor and compiler
    professional looking scenarios are possible.
                                                                                                   • Built-in access to documentation
    Greenfoot was developed by the group that previously designed BlueJ, another popular           • Online and print tutorial available
    educational environment. It inherits much of BlueJ’s simplicity and clear educational          • Experimentation with individual
    design.                                                                                          objects
                                                                                                   • Publish projects to the internet

    Greenfoot is free                                                                              • See projects at
    DOWNLOAD IT FROM ITS WEB SITE                                                                  • Great community support
    NO TRIAL VERSION, NO RESTRICTIONS                                                              • Free!

                                                                                                  Supported by
                                                                                                  Sun Microsystems

                                      G           R         E          E           N           F         O          O          T

                                  of the
R etu                          rn
The Greenfoot Programming Challenge at SIGCSE 2009, Chattanooga, Tennessee
    Some rules 
                                                                                                                           for clarification – ask!

Rule 1                       Rule 2                      Rule 3                        Rule 4                    Rule 5                     Rule 6
                             You cannot extend the       You can call any              Greeps have natural       No creation of objects.    You are not allowed to
                             Greeps’ memory. That        method defined in the          GPS sensitivity. You      You are not allowed to     call any methods (other
                             is: you are not allowed     "Greep" superclass,           can call getX()/getY()    create any scenario        than those listed in
                             to add fields (other than    except act().                 on any object and get/    objects (instances of      Rule 4) of any other
                             final fields) to the class.                                 setRotation() on your-    user-defined classes,       class in this scenario
                             Some general purpose                                      self any time. Friendly   such as MyGreep).          (including Actor and
                             memory is provided.                                       greeps can communi-       Greeps have no magic       World).
Only change the class        (The ship can also store                                  cate. You can call get-   powers – they cannot
‘MyGreep’. No other          data.)                                                    Memory() and get-         create things out of
classes may be modified                                                                 Flag() on another greep   nothing.
or created.                                                                            to ask what they know.

                                                                                                                  You will work mainly with the inherited methods

They’re back!                                                                                                    from Greep – familiarize yourself with them.

                                                                                                                 A small number of other methods may be called
                                                                                                                 (see Rule 4) – otherwise no methods of any of the
At SIGCSE 2007, Greeps invaded for the first time,                                                                other objects in the world may be called. (You can
looking for tomatoes. Now they’re back! And this time,                                                           use any standard Java class and method.)
it’s personal...
                                                                                                                 Greeps have some limited memory: four integers
Welcome to the Greenfoot programming competi-                                                                    and two Boolean flags. You can make use of this
tion. Write your own Greep class and win!                                                                        for whatever you like, but you cannot extend it.

 1st & 2nd place: Sony PlayStation 3                                                                     Greeps can read the memory of their friends when
                                                            Tomatoes. Greeps love tomatoes. They eat

         3rd & 4th place: Livescribe Smartpen                                                                   they touch. They can also get access to the ship’s
                                                           tomatoes. In fact, they eat nothing else but
                                                                                                                 data bank to read and write information (but only
Greeps are back on Earth to look for tomatoes               tomatoes. Since there is an acute tomato
                                                                                                                 when they are at the ship). This may be useful for
again. As before, they collect tomatoes and carry          shortage on their home planet they have to
                                                                                                                 sharing valuable information.
them home to their ship. This time, however, two              collect as many as they can on Earth.
competing tribes of Greeps have landed at the                                                                    Greeps cannot load tomatoes on their own – a
same spot and are competing for the goodies. Oc-         You should edit only the MyGreep class. You can-        Greep can only load a tomato onto another Greep.
casionally, they use nasty tactics to beat the other     not change any of the other classes. Program some
tribe: they can, for instance, release a noxious gas                                                             Greeps can block an area around them - opponents
                                                         intelligence into the little critters, and make them
that knocks everyone out who smells it. They may                                                                 cannot enter the blocked area. They can also re-
                                                         carry the tomatoes to their space ship quicker than
also block each other’s way.                                                                                     lease an extremely noxious gas that temporarily
                                                         ever before.
                                                                                                                 knocks everyone out. Make good use of these abili-
In this competition, your task is to get your Greeps     When done, submit your class (only the file              ties!
to collect as many tomatoes as they can in limited       “”) back to us for scoring. To submit
time. Write an implementation for class MyGreep,         your entry, bring it to the booth on a USB memory       The Grand Final
submit it to us, and we’ll see how you score.            stick.                                                  In the first round (Thu/Fri), scores are determined
How to participate                                                                                               by running against a House Greep. On Saturday
                                                         Anyone can enter – individuals and teams – and
                                                                                                                 (10:10 - 10:40), the top four teams will enter the
                                                         you can submit as often as you like.
Get Greenfoot and the “greeps-return” project                                                                    final: These teams will run against each other to
from, or from us at the Green-         Some tips                                               determine the overall winners. Participants must
foot booth. Install Greenfoot on your laptop, open                                                               be present to take part in the final.
the project, and improve the “MyGreep” class.            You will see that MyGreep is a subclass of Greep.

The Greenfoot Programming Competition, March 2009