1 / 21

Jeroo Basics

Jeroo Basics. What is Jeroo?. Jeroos are a rare mammal similar to the wallabies of Australia. Jeroos live on Santong Island. Jeroos eat the winsum flower which grows on the island. Creating a Jeroo. This code creates a Jeroo at location 0,0. constructors. Jeroo bob = new Jeroo(5,15);

leala
Download Presentation

Jeroo Basics

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Jeroo Basics

  2. What is Jeroo? • Jeroos are a rare mammal similar to the wallabies of Australia. • Jeroos live on Santong Island. • Jeroos eat the winsum flower which grows on the island.

  3. Creating a Jeroo This code creates a Jeroo at location 0,0.

  4. constructors • Jeroo bob = new Jeroo(5,15); • //creates a Jeroo at location 5,15 • Jeroo jim = new Jeroo(5); • //creates a Jeroo at location 0,0 with 5 flowers • Jeroo sue = new Jeroo(2,11,9); • //creates a Jeroo at location 2,11 with 9 flowers

  5. constructors • Jeroo jan = new Jeroo(11,7,WEST); • //creates a Jeroo at location 11,7 • //that is facing WEST • Jeroo dan = new Jeroo(8,2,EAST,3); • //creates a Jeroo at location 8,2 • //that is facing EAST with 3 flowers

  6. Object Instantiation Jeroo bob = newJeroo(); bob 0x234 0x234 Jeroo Bob is a reference variable that refers to a Jeroo object.

  7. Open jeroo_constructors.jsc

  8. What can a Jeroo do?

  9. hop() Jeroo dude = new Jeroo(3,3); dude.hop(); dude.hop(); dude.hop(3); dude.hop();

  10. Open jeroo_hop.jsc

  11. plant() Jeroo dude = new Jeroo(3,3,7); dude.plant(); dude.hop(); dude.plant(); dude.hop(3); dude.plant(); dude.hop(2);

  12. Open jeroo_plant.jsc

  13. turn() Jeroo bob = new Jeroo(4); bob.hop(4); bob.plant(); bob.turn(RIGHT); bob.hop(4); bob.plant(); bob.turn(RIGHT); bob.hop(4); bob.plant(); bob.turn(RIGHT); bob.hop(4); bob.plant();bob.turn(RIGHT);

  14. Open jeroo_turn.jsc

  15. give() Jeroo bob = new Jeroo(2); Jeroo ann = new Jeroo(0,3); bob.hop(); bob.hop(); bob.give(AHEAD); ann.plant(); bob.turn(RIGHT); bob.hop(4); ann.hop(2);

  16. Open jeroo_give.jsc

  17. Moving a Jeroo This creates a Jeroo and moves it around the screen to 2,0.

  18. Open jeroo_move.jsc

  19. Start work on Basic Labs

More Related