**Create your own graph by moving ship across the screen!


A+    A−    B  
Home
Algebra
Math Games
Geometry
Private Tutors
Interactive
Trigonometry
Jobs
Teacher Resources
On Facebook



AddThis Social Bookmark Button

Jeroo : Getting Starting

How to Declare & Instantiate

Jeroo: How to Instantiate a Jeroo

A youtube video that I made up on how to use Jeroo.
method main()
{
...code here..
}


   
  

Creating a new Jeroo


Jeroos do not exist until you say so. To create a Jeroo, you have to declare the Jeroo, and then instantiate the Jeroo. Declaration means that you give the Jeroo a name. Instantiation means that you give the Jeroo some character traits, such as starting position, the direction she faces, or how many flowers she has. For example,

How to Instantiate and Declare a Jeroo
How to tell how many flowers a Jeroo has

Making the Jeroo do something

Now that you have created a Jeroo named Kim, you want her to do something. Jeroos can do a few things. They can hop, pick a flower, plant a flower, toss a flower, and turn to face a new direction.

Here is how you make Kim hop:

  Kim.hop();

Here is how you make Kim pick a flower:
  Kim.pick();

Here is how you make Kim toss a flower. She'll toss to the square directly in front of her automatically.
  Kim.toss();

Can you guess how to make Kim plant a flower?
  Kim._?_();
She'll plant the flower whereever she is standing.

If you want Kim to turn, you have to tell her which direction you want her to turn - LEFT or RIGHT.
  Kim.turn(RIGHT);

Next


Top
AddThis Social Bookmark Button