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,
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:
Here is how you make Kim
pick a flower:
Here is how you make Kim
toss a flower. She'll toss to the square directly in
front of her automatically.
Can you guess how to make Kim
plant a flower?
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.