You must login or register to participate.

Description

Learn Java, the language of the internet!  No prior experience required!

To get started, JOIN THIS GROUP. Then click on the Activities tab. Next complete each of the Activities. And finally compete in the Challenge Activity.

Click the Details tab for more information. After you've completed this path, if you've enjoyed it and want to go further, check out some of the other programming learning paths, including Make a 3D Video Game and Building Flashy Websites with JavaFX.

Learning Path and Challenge Activity Provided By

FreshBrain is proud to sponsor the "Learn Java Programming" learning path and challenge activity.

Greenfoot Support Classes - Let's Makes Some Moves

Greenfoot Support Classes - Let's Makes Some Moves

Description

This activity will have you create a new actor subclass using the Greenfoot support class collection.  In this activity, you will:

  • Create a new class Mover by reusing a Greenfoot Support Class.
  • Create a subclass of Mover and show how to use its features.
  • Run the scenario.
  • Learn some Java constructs and programming concepts along with reviewing the code.

Skills you will learn include:

  • Being able to use the Greenfoot support classes and API documentation to create your own new classes and subclasses.
  • Learn Java as well as basic programming concepts and constructs.

Basic Steps

  1. Start up Greenfoot.
  2. From the Scenario menu, select the scenario called Monsters.
  3. Next, create a subclass of Actor called Mover. Open the editor and copy and paste this code for the Mover class.  You can learn more about Mover and other Greenfoot Support Classes in the Greenfoot Programmer's Manual.
  4. Create a subclass of Mover.  We’ll call it MovingMonster.  Choose a monster image from the librarycreate your own image or use this image.
  5. Edit MovingMonster, adding a method called act().  The code for act() can be found here.
  6. Compile, add MovingMonster objects and run the scenario.  This time when you click run, randomly hold down the left arrow OR the right arrow keys.  See how the behavior changes.
  7. Learn more about the Greenfoot Mover class and additional Java programming tips at the Greenfoot Support Classes - Digging Deeper page.
  8. Please read the following instructions for preparing your work prior to submission to this activity.
  9. Select Scenario -> Export.  Choose  Webpage (from Publish, Webpage, Application) and select a location to save the scenario as an applet (a jar file and a .html file).
  10. Submit the exported jar file for this activity.

Suggested Activity Tools

Resource Links

Recent Submissions

icon

Moving Monsters

0
September 10, 2009 by cerpintaxt
icon

Activiy 5 - Moving Monsters

0
August 12, 2009 by lekha
icon

Monster on paper

0
August 4, 2009 by mondegreen
icon

Moving Monsters

0
July 31, 2009 by zackiddy
icon

Yet another Wombat World

0
December 19, 2009 by Fireater989
icon

Monsters 2

0
August 16, 2009 by Ryanh423
icon

Activity 5

0
August 4, 2009 by sunshinehombre
icon

SpearingTeddyBears.

0
July 31, 2009 by cheez246890
icon

Movers and Sliders

0
July 29, 2009 by Jkmc
More Submissions

Activity Forum

There are currently no forum topics posted.