SlideShare une entreprise Scribd logo
1  sur  17
Introduction To
                            Greenfoot
                               Part-3


kakihijau.googlepages.com
Disclaimer
 This document is intended to give a beginner an introductory
  material for the Greenfoot system. Greenfoot is a software
  framework made by Poul Henriksen and Michael Koelling at
  University of Kent / Deakin University. More information can be
  found at http://www.greenfoot.org

 This document is available „AS IS“ free of charge for personal use
  and non-commercial redistribution. It may not be sold for profit or
  included in other packages which are sold for profit without written
  authorisation. This document is distributed in the hope that it will
  be useful, but WITHOUT ANY WARRANTY; your use of the
  document is at your sole risk. Reusing and modifying (part of) this
  document is allowed, as long as you state explicitly that your work is
  based on the original document produced by the copyright holder:
  Eueung Mulyana. The author can be contacted via
  eueung-[at]-yahoo.com (http://kakihijau.googlepages.com).


                                                     Introduction to Greenfoot              2
                                               Eueung Mulyana | kakihijau.googlepages.com
Purpose
 This is the second part of the document „Introduction to
  Greenfoot“ and focuses on two topics: modification and
  programming of the wombats scenario

 Part of the content of these slides is based on the
  Greenfoot Tutorial made by Michael Koelling,
  publicly accesible at the Greenfoot website,
  http://www.greenfoot.org




                                              Introduction to Greenfoot              3
                                        Eueung Mulyana | kakihijau.googlepages.com
Outline
 Changing the Behaviour
 Changing Representations
 Creating New Classes




                                    Introduction to Greenfoot              4
                              Eueung Mulyana | kakihijau.googlepages.com
Changing the Behaviour (1)
 We want to change the behaviour of Wombat objects :
  instead of always turning left, they shall be able to turn to
  other directions in a random way
 We will add an additional method, called turnRandom()
 Open the source code of the Wombat class, add the
  following codes

                                             Generate a random
                                             number between 0 and 3


 call turnLeft()
 turns times



                                               Introduction to Greenfoot              5
                                         Eueung Mulyana | kakihijau.googlepages.com
Changing the Behaviour (2)


                 if you find leaves, eat !

                 if you don‘t find leaves, but you
                 can move forward, then move!

                 if you don‘t find leaves and you
                 also cannot move, then turn to a
                 random direction!




                        Introduction to Greenfoot              6
                  Eueung Mulyana | kakihijau.googlepages.com
Changing the Behaviour (3)




                        Introduction to Greenfoot              7
                  Eueung Mulyana | kakihijau.googlepages.com
Changing Representations (1)
 Visual representation (image) of an object can be
  changed in two different ways
   – Changing the „class image“; in this way, all objects of the same
     class shall look the same (to the assigned class image)
   – Changing the image programmatically; in this way, objects of the
     same class might look different, depending on the
     implementation


 These two ways might be combined!




                                                   Introduction to Greenfoot              8
                                             Eueung Mulyana | kakihijau.googlepages.com
Changing Representations (2)




                         Introduction to Greenfoot              9
                   Eueung Mulyana | kakihijau.googlepages.com
Changing Representations (3)




                         Introduction to Greenfoot              10
                   Eueung Mulyana | kakihijau.googlepages.com
Changing Representations (4)




  the result of populate()       Additionally change the class image
after changin the class image   then add 2 objects after modification
                                               Introduction to Greenfoot              11
                                         Eueung Mulyana | kakihijau.googlepages.com
Changing Representations (5)




               to set the image of an object
                     programmatically




                                Introduction to Greenfoot              12
                          Eueung Mulyana | kakihijau.googlepages.com
Changing Representations (6)




                         Introduction to Greenfoot              13
                   Eueung Mulyana | kakihijau.googlepages.com
Creating New Classes (1)
 We could not only modify the                     class image for
                                                   the Rock class
  behaviour of objects, but also add a
  completely new type of objects i.e.
  create new classes
 Right-click the class Actor and
  choose item „New subclass ...“,
  enter the class name and select a
  class image in the dialog;
  Greenfoot will automatically
  generate your class !
 In this case we add a new class,
  called Rock. The image for this        images available in the wombats
  class is already available in the              scenario folder
  wombats scenario folder

                                               Introduction to Greenfoot              14
                                         Eueung Mulyana | kakihijau.googlepages.com
Creating New Classes (2)




                       Introduction to Greenfoot              15
                 Eueung Mulyana | kakihijau.googlepages.com
Creating New Classes (3)

 To stop wombats
  from walking
  through rocks ...


 check all Rock objects
 in front of you;
 if there is no Rock object,
 return true (i.e. okay it‘s
 clear!) , otherwise return
 false (i.e. you cannot move!)




                                       Introduction to Greenfoot              16
                                 Eueung Mulyana | kakihijau.googlepages.com
Creating New Classes (4)




                       Introduction to Greenfoot              17
                 Eueung Mulyana | kakihijau.googlepages.com

Contenu connexe

Plus de Eueung Mulyana

Open Source Networking Overview
Open Source Networking OverviewOpen Source Networking Overview
Open Source Networking OverviewEueung Mulyana
 
ONOS SDN Controller - Clustering Tests & Experiments
ONOS SDN Controller - Clustering Tests & Experiments ONOS SDN Controller - Clustering Tests & Experiments
ONOS SDN Controller - Clustering Tests & Experiments Eueung Mulyana
 
Open stack pike-devstack-tutorial
Open stack pike-devstack-tutorialOpen stack pike-devstack-tutorial
Open stack pike-devstack-tutorialEueung Mulyana
 
ONOS SDN Controller - Introduction
ONOS SDN Controller - IntroductionONOS SDN Controller - Introduction
ONOS SDN Controller - IntroductionEueung Mulyana
 
OpenDaylight SDN Controller - Introduction
OpenDaylight SDN Controller - IntroductionOpenDaylight SDN Controller - Introduction
OpenDaylight SDN Controller - IntroductionEueung Mulyana
 
Android Programming Basics
Android Programming BasicsAndroid Programming Basics
Android Programming BasicsEueung Mulyana
 
Cloud Computing: Overview and Examples
Cloud Computing: Overview and ExamplesCloud Computing: Overview and Examples
Cloud Computing: Overview and ExamplesEueung Mulyana
 
selected input/output - sensors and actuators
selected input/output - sensors and actuatorsselected input/output - sensors and actuators
selected input/output - sensors and actuatorsEueung Mulyana
 
Connected Things, IoT and 5G
Connected Things, IoT and 5GConnected Things, IoT and 5G
Connected Things, IoT and 5GEueung Mulyana
 
Connectivity for Local Sensors and Actuators Using nRF24L01+
Connectivity for Local Sensors and Actuators Using nRF24L01+Connectivity for Local Sensors and Actuators Using nRF24L01+
Connectivity for Local Sensors and Actuators Using nRF24L01+Eueung Mulyana
 
NodeMCU with Blynk and Firebase
NodeMCU with Blynk and FirebaseNodeMCU with Blynk and Firebase
NodeMCU with Blynk and FirebaseEueung Mulyana
 
Trends and Enablers - Connected Services and Cloud Computing
Trends and Enablers  - Connected Services and Cloud ComputingTrends and Enablers  - Connected Services and Cloud Computing
Trends and Enablers - Connected Services and Cloud ComputingEueung Mulyana
 
Digital Ecosystems - Connected Services and Cloud Computing
Digital Ecosystems - Connected Services and Cloud ComputingDigital Ecosystems - Connected Services and Cloud Computing
Digital Ecosystems - Connected Services and Cloud ComputingEueung Mulyana
 
Services Convergence - Connected Services and Cloud Computing
Services Convergence - Connected Services and Cloud ComputingServices Convergence - Connected Services and Cloud Computing
Services Convergence - Connected Services and Cloud ComputingEueung Mulyana
 
Models and Architecture - Connected Services and Cloud Computing
Models and Architecture - Connected Services and Cloud ComputingModels and Architecture - Connected Services and Cloud Computing
Models and Architecture - Connected Services and Cloud ComputingEueung Mulyana
 
Introduction, Examples - Firebase
Introduction, Examples - Firebase Introduction, Examples - Firebase
Introduction, Examples - Firebase Eueung Mulyana
 
Vue js and Vue Material
Vue js and Vue MaterialVue js and Vue Material
Vue js and Vue MaterialEueung Mulyana
 
React Example + Bootstrap
React Example + BootstrapReact Example + Bootstrap
React Example + BootstrapEueung Mulyana
 

Plus de Eueung Mulyana (20)

Open Source Networking Overview
Open Source Networking OverviewOpen Source Networking Overview
Open Source Networking Overview
 
ONOS SDN Controller - Clustering Tests & Experiments
ONOS SDN Controller - Clustering Tests & Experiments ONOS SDN Controller - Clustering Tests & Experiments
ONOS SDN Controller - Clustering Tests & Experiments
 
Open stack pike-devstack-tutorial
Open stack pike-devstack-tutorialOpen stack pike-devstack-tutorial
Open stack pike-devstack-tutorial
 
Basic onos-tutorial
Basic onos-tutorialBasic onos-tutorial
Basic onos-tutorial
 
ONOS SDN Controller - Introduction
ONOS SDN Controller - IntroductionONOS SDN Controller - Introduction
ONOS SDN Controller - Introduction
 
OpenDaylight SDN Controller - Introduction
OpenDaylight SDN Controller - IntroductionOpenDaylight SDN Controller - Introduction
OpenDaylight SDN Controller - Introduction
 
Mininet Basics
Mininet BasicsMininet Basics
Mininet Basics
 
Android Programming Basics
Android Programming BasicsAndroid Programming Basics
Android Programming Basics
 
Cloud Computing: Overview and Examples
Cloud Computing: Overview and ExamplesCloud Computing: Overview and Examples
Cloud Computing: Overview and Examples
 
selected input/output - sensors and actuators
selected input/output - sensors and actuatorsselected input/output - sensors and actuators
selected input/output - sensors and actuators
 
Connected Things, IoT and 5G
Connected Things, IoT and 5GConnected Things, IoT and 5G
Connected Things, IoT and 5G
 
Connectivity for Local Sensors and Actuators Using nRF24L01+
Connectivity for Local Sensors and Actuators Using nRF24L01+Connectivity for Local Sensors and Actuators Using nRF24L01+
Connectivity for Local Sensors and Actuators Using nRF24L01+
 
NodeMCU with Blynk and Firebase
NodeMCU with Blynk and FirebaseNodeMCU with Blynk and Firebase
NodeMCU with Blynk and Firebase
 
Trends and Enablers - Connected Services and Cloud Computing
Trends and Enablers  - Connected Services and Cloud ComputingTrends and Enablers  - Connected Services and Cloud Computing
Trends and Enablers - Connected Services and Cloud Computing
 
Digital Ecosystems - Connected Services and Cloud Computing
Digital Ecosystems - Connected Services and Cloud ComputingDigital Ecosystems - Connected Services and Cloud Computing
Digital Ecosystems - Connected Services and Cloud Computing
 
Services Convergence - Connected Services and Cloud Computing
Services Convergence - Connected Services and Cloud ComputingServices Convergence - Connected Services and Cloud Computing
Services Convergence - Connected Services and Cloud Computing
 
Models and Architecture - Connected Services and Cloud Computing
Models and Architecture - Connected Services and Cloud ComputingModels and Architecture - Connected Services and Cloud Computing
Models and Architecture - Connected Services and Cloud Computing
 
Introduction, Examples - Firebase
Introduction, Examples - Firebase Introduction, Examples - Firebase
Introduction, Examples - Firebase
 
Vue js and Vue Material
Vue js and Vue MaterialVue js and Vue Material
Vue js and Vue Material
 
React Example + Bootstrap
React Example + BootstrapReact Example + Bootstrap
React Example + Bootstrap
 

Dernier

Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 

Dernier (20)

INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 

Greenfoot Introduction (3)

  • 1. Introduction To Greenfoot Part-3 kakihijau.googlepages.com
  • 2. Disclaimer  This document is intended to give a beginner an introductory material for the Greenfoot system. Greenfoot is a software framework made by Poul Henriksen and Michael Koelling at University of Kent / Deakin University. More information can be found at http://www.greenfoot.org  This document is available „AS IS“ free of charge for personal use and non-commercial redistribution. It may not be sold for profit or included in other packages which are sold for profit without written authorisation. This document is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; your use of the document is at your sole risk. Reusing and modifying (part of) this document is allowed, as long as you state explicitly that your work is based on the original document produced by the copyright holder: Eueung Mulyana. The author can be contacted via eueung-[at]-yahoo.com (http://kakihijau.googlepages.com). Introduction to Greenfoot 2 Eueung Mulyana | kakihijau.googlepages.com
  • 3. Purpose  This is the second part of the document „Introduction to Greenfoot“ and focuses on two topics: modification and programming of the wombats scenario  Part of the content of these slides is based on the Greenfoot Tutorial made by Michael Koelling, publicly accesible at the Greenfoot website, http://www.greenfoot.org Introduction to Greenfoot 3 Eueung Mulyana | kakihijau.googlepages.com
  • 4. Outline  Changing the Behaviour  Changing Representations  Creating New Classes Introduction to Greenfoot 4 Eueung Mulyana | kakihijau.googlepages.com
  • 5. Changing the Behaviour (1)  We want to change the behaviour of Wombat objects : instead of always turning left, they shall be able to turn to other directions in a random way  We will add an additional method, called turnRandom()  Open the source code of the Wombat class, add the following codes Generate a random number between 0 and 3 call turnLeft() turns times Introduction to Greenfoot 5 Eueung Mulyana | kakihijau.googlepages.com
  • 6. Changing the Behaviour (2) if you find leaves, eat ! if you don‘t find leaves, but you can move forward, then move! if you don‘t find leaves and you also cannot move, then turn to a random direction! Introduction to Greenfoot 6 Eueung Mulyana | kakihijau.googlepages.com
  • 7. Changing the Behaviour (3) Introduction to Greenfoot 7 Eueung Mulyana | kakihijau.googlepages.com
  • 8. Changing Representations (1)  Visual representation (image) of an object can be changed in two different ways – Changing the „class image“; in this way, all objects of the same class shall look the same (to the assigned class image) – Changing the image programmatically; in this way, objects of the same class might look different, depending on the implementation  These two ways might be combined! Introduction to Greenfoot 8 Eueung Mulyana | kakihijau.googlepages.com
  • 9. Changing Representations (2) Introduction to Greenfoot 9 Eueung Mulyana | kakihijau.googlepages.com
  • 10. Changing Representations (3) Introduction to Greenfoot 10 Eueung Mulyana | kakihijau.googlepages.com
  • 11. Changing Representations (4) the result of populate() Additionally change the class image after changin the class image then add 2 objects after modification Introduction to Greenfoot 11 Eueung Mulyana | kakihijau.googlepages.com
  • 12. Changing Representations (5) to set the image of an object programmatically Introduction to Greenfoot 12 Eueung Mulyana | kakihijau.googlepages.com
  • 13. Changing Representations (6) Introduction to Greenfoot 13 Eueung Mulyana | kakihijau.googlepages.com
  • 14. Creating New Classes (1)  We could not only modify the class image for the Rock class behaviour of objects, but also add a completely new type of objects i.e. create new classes  Right-click the class Actor and choose item „New subclass ...“, enter the class name and select a class image in the dialog; Greenfoot will automatically generate your class !  In this case we add a new class, called Rock. The image for this images available in the wombats class is already available in the scenario folder wombats scenario folder Introduction to Greenfoot 14 Eueung Mulyana | kakihijau.googlepages.com
  • 15. Creating New Classes (2) Introduction to Greenfoot 15 Eueung Mulyana | kakihijau.googlepages.com
  • 16. Creating New Classes (3)  To stop wombats from walking through rocks ... check all Rock objects in front of you; if there is no Rock object, return true (i.e. okay it‘s clear!) , otherwise return false (i.e. you cannot move!) Introduction to Greenfoot 16 Eueung Mulyana | kakihijau.googlepages.com
  • 17. Creating New Classes (4) Introduction to Greenfoot 17 Eueung Mulyana | kakihijau.googlepages.com