Kakihijau.googlepages.com Introduction To Greenfoot Part-1.

Slides:



Advertisements
Similar presentations
Jump to Contents Instructor Tutorial essignments.com Paperless assignment submission system.
Advertisements

GridWorld Case Study Part 1 Experiments to Observe Attributes and Behavior of Actors A Summary by Jim Mims.
Windows Basics An Introduction to the Windows Operating System.
Problem Solving with Data Structures using Java: A Multimedia Approach Chapter 14: Using an Existing Simulation Package Download greenfoot and install.
Getting to know Greenfoot
Fireworks MX. 2 Lesson 1a—Create Slices & Hotspots n Fireworks allows you to add animation (behaviors) already written in ___________. n However, users.
of Kent A practical introduction to Greenfoot David Barnes Lecturer in Computer Science University of.
Wombats Creating Games with Greenfoot The Walker School – Games and Simulations
Chapter 1 - Getting to know Greenfoot Bruce Chittenden.
Chapter 1 - Getting to know Greenfoot Acknowledgement: Michael Kolling & Bruce Chittenden.
View Controllers (second part) Content taken from book: “iPhone SDK Development” by Bill Dudney and Chris Adamson.
Automating Tasks With Macros
Macros Tutorial Week 20. Objectives By the end of this tutorial you should understand how to: Create macros Assign macros to events Associate macros with.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Food Chain Game By: Jack and Anthony Lets get ready to play!
Access Tutorial 10 Automating Tasks with Macros
®® Microsoft Windows 7 Windows Tutorial 1 Exploring the Basics of Microsoft Windows 7.
2. Introduction to the Visual Studio.NET IDE 2. Introduction to the Visual Studio.NET IDE Ch2 – Deitel’s Book.
Analysis Modeling (cont’d) CpSc 372: Introduction to Software Engineering Jason O. Hallstrom Authorship Disclaimer. These slides.
INTRODUCTION TO THE SCRATCH PROGRAMMING ENVIRONMENT.
Created by NW 2012 – please note all copyright on images used is property of copyright holder. Note: some of the more complicated descriptions are taken.
Copyright ©: SAMSUNG & Samsung Hope for Youth. All rights reserved Tutorials Software: Building apps Suitable for: Advanced.
1 iSee Player Tutorial Using the Forest Biomass Accumulation Model as an Example ( Tutorial Developed by: (
INTRODUCTION TO C PROGRAMMING LANGUAGE Computer Programming Asst. Prof. Dr. Choopan Rattanapoka and Asst. Prof. Dr. Suphot Chunwiphat.
Chapter 10 Introduction to Components. Process Phases Discussed in This Chapter Requirements Analysis Design Implementation ArchitectureFramework Detailed.
Creating a Presentation
Problem Solving with Data Structures using Java: A Multimedia Approach Chapter 14: Using an Existing Simulation Package.
Department of Mechanical Engineering, LSUSession VII MATLAB Tutorials Session VIII Graphical User Interface using MATLAB Rajeev Madazhy
Thank you for your decision to try vTreePro Practice Tree Software! Your satisfaction is very important to us. Please feel free to send us an if.
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
Greenfoot. Getting Started Open the Greenfoot download site: Select Greenfoot
Creating a PowerPoint Presentation
1 1 Lab1 Ismail M. Romi – IT Dept, PPU, Visual Basic 2005 Programming Tour.
Java Software Solutions Lewis and Loftus Chapter 10 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Graphical User Interfaces --
CSC 142 B 1 CSC 142 Java objects: a first view [Reading: chapters 1 & 2]
Alice 2.0 Introductory Concepts and Techniques Project 1 Exploring Alice and Object-Oriented Programming.
1 Object-Oriented Software Engineering CS GUI building with NetBeans Contents User Interaction JButtons JTextFields JLabels JForms in NetBeans Practical.
Using the Web-Based Training Tool MyFloridaMarketPlace.
Chapter 1 - Getting to know Greenfoot
Introduction In The Name Of Allah, The Beneficent, The Merciful.
CREATING A POWERPOINT PRESENTATION. Planning a presentation Create a presentation Rearrange and delete text and slides Add animations Add transitions.
XP Tutorial 4 Special Animations. XP New Perspectives on Macromedia Flash MX Special Layers for Animation Animation Using a Motion Guide Layer.
SWE 316: Software Design and Architecture Objectives Lecture # 18 Introduction to Components SWE 316: Software Design and Architecture To learn:  benefits.
Lecture 4. Greenfoot 1 Pablo Romero, Department of Informatics Greenfoot Programming simulations and games in Java.
Greenfoot Game Programming Club.
SilkTest 2008 R2 SP1: Silk4J Introduction. ConfidentialCopyright © 2008 Borland Software Corporation. 2 What is Silk4J? Silk4J enables you to create functional.
CSC 142 B 1 CSC 142 Java objects: a first view [Reading: chapters 1 & 2]
Lesson 1: Writing a program. Java Java is a programming language Computer cannot understand it, though it can be translated ( compiled ) so a computer.
Kakihijau.googlepages.com Introduction To Greenfoot Part-2.
Introduction To Greenfoot
BUG COLLECTING PowerPoint Review Game By Catherine Slight and Lin Pearson How to work the PowerPoint This game is made of two PowerPoint presentation.
File and File Systems Compiled by IITG Team Need to be reorganized and reworded.
Computer Basics Tutorial Text boxes like this will give you information. Boxes like this at the bottom of a slide will give you instructions. Press the.
Continue Central Fire Command Hello Recruit, glad to see you. We need some good fire fighters, and I hope you can become one of us. I need you to first.
Kakihijau.googlepages.com Introduction To Greenfoot Part-3.
Newton’s Lab Games and Simulations O-O Programming in Java.
Introducing Scratch Learning resources for the implementation of the scenario
Greenfoot.
Introduction To Greenfoot
Introduction to Object-oriented Program Design
Creating Games with Greenfoot
Version 2.
Classes and Objects Still Chapter 1.
Constructors, GUI’s(Using Swing) and ActionListner
Methods, Data and Data Types
Java objects: a first view
Greenfoot November 8, 2009.
Poul Henriksen Computing Laboratory University of Kent
Presentation transcript:

kakihijau.googlepages.com Introduction To Greenfoot Part-1

Introduction to Greenfoot Eueung Mulyana | 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  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 (

Introduction to Greenfoot Eueung Mulyana | kakihijau.googlepages.com 3 Introduction  „Greenfoot is a software tool designed to let beginners get experience with object-oriented programming. It supports development of graphical applications in the Java™ Programming Language“  Designed and implemented at the University of Kent and Deakin University  Copyright held by Poul Henriksen and Michael Koelling  More information at  Part of the content of these slides is based on the Greenfoot Tutorial made by Michael Koelling, publicly accesible at the website

Introduction to Greenfoot Eueung Mulyana | kakihijau.googlepages.com 4 Outline  Visual Interface  Creating Objects  Interaction with Objects  Removing Objects  Objects‘ Action  Simulation „Run“  Scenario plane  Scenario turtleGraphics  Scenario ants  Scenario lunarlander

Introduction to Greenfoot Eueung Mulyana | kakihijau.googlepages.com 5 Visual Interface (scenario wombats)

Introduction to Greenfoot Eueung Mulyana | kakihijau.googlepages.com 6 Visual Interface  Consists of 3 main parts  The world –The large canvas that covers the majority of the window –Has a title e.g. WombatWorld –The enviroment („the world“) where objects exist  Class display –Contains all Java classes involved in the scenario –3 groups: World, Actor and other classes  Execution controls –Controls the action of each object: the „Act“ button –Controls simulation: „Run“, „Pause“, slider –Resets the scenario

Introduction to Greenfoot Eueung Mulyana | kakihijau.googlepages.com 7 Creating Objects (1)  (Left-)Click on the Wombat or Leaf class to make it active  To create and place an object into the world : –Activate a class then shift+click somewhere in the World –Right-click a class (e.g. Wombat class) to open the class context menu, select the „New Wombat()“ item then click somewhere in the World

Introduction to Greenfoot Eueung Mulyana | kakihijau.googlepages.com 8 Creating Objects (2) Class context menu Creating 3 objects and placing them into the World

Introduction to Greenfoot Eueung Mulyana | kakihijau.googlepages.com 9 Interaction with Objects (1)  Methods of an object can directly be invoked  „A method is a single action that an object can perform“  Right-click on one object to show its (object) context menu, where you can select a method to ask the object to do „something“ turnleft()move()

Introduction to Greenfoot Eueung Mulyana | kakihijau.googlepages.com 10 Interaction with Objects (2)  The world where the wombats live (WombatWorld) is actually an object, too  But there may exist only one World object at a time  It functions as a container for Actor objects (e.g. Wombat, Leaf etc.)  Single method invocation is still possible for the World object; just right-click the title „WombatWorld“ and select a method from the menu

Introduction to Greenfoot Eueung Mulyana | kakihijau.googlepages.com 11 Interaction with Objects (3) populate()randomLeaves()

Introduction to Greenfoot Eueung Mulyana | kakihijau.googlepages.com 12 Interaction with Objects (4)  A method may have one or more parameters  You will be requested to give value(s) of the parameter(s) when you invoke such a method  Try the method setDirection() from a Wombat object or the method randomLeaves() from the WombatWorld  A method may also return one value (or reference to an object) if it is invoked  Try foundLeaf() or getLeavesEaten() from a Wombat object

Introduction to Greenfoot Eueung Mulyana | kakihijau.googlepages.com 13 Removing Objects (1)  An object can be removed by selecting item „Remove“ from the object context menu  Clicking the „Reset“ button or creating a new World object from the class context menu may remove all objects; however it actually depends on the constructor implementation of the World class  (*)

Introduction to Greenfoot Eueung Mulyana | kakihijau.googlepages.com 14 Removing Objects (2)

Introduction to Greenfoot Eueung Mulyana | kakihijau.googlepages.com 15 Objects‘ Action  Each Actor object has a special method called act()  Pressing the button „Act“ on the control panel means asking Greenfoot to execute act() method for all objects in the world  An object acts by doing „whatever it wants to do“ e.g.: –Wombats move forward, if they find a leaf in their path, they will eat it –Leaves do nothing  The action depends actually on how act() method is defined; that is, we can program object behaviors!!

Introduction to Greenfoot Eueung Mulyana | kakihijau.googlepages.com 16 Simulation „Run“  A scenario can be run by clicking the „Run“ button  This equivalent to clicking the „Act“ button over and over again very quickly  The slider next to the „Act“ and „Run“ buttons sets the „running/simulation“ speed  Make an experiment with scenario wombats –Click „Reset“ if you have already some objects –Select Populate() from the WombatWorld menu –Click „Run“

Introduction to Greenfoot Eueung Mulyana | kakihijau.googlepages.com 17 Simulation „Run“ Running wombats scenario

Introduction to Greenfoot Eueung Mulyana | kakihijau.googlepages.com 18 Scenario plane (1)  Choose „Open...“ from the „Scenario“ menu and select the plane scenario from the Greenfoot sample scenarios  Press the „Compile all“ button, if necessary  Instantiate a Plane object and place somewhere in the world  Run the scenario by pressing „Run“  Try to drag the ControlKnob object and observe the result

Introduction to Greenfoot Eueung Mulyana | kakihijau.googlepages.com 19 Scenario plane (2)

Introduction to Greenfoot Eueung Mulyana | kakihijau.googlepages.com 20 Scenario plane (3)

Introduction to Greenfoot Eueung Mulyana | kakihijau.googlepages.com 21 Scenario turtleGraphics (1)  Choose „Open...“ from the „Scenario“ menu and select the turtleGraphics scenario from the Greenfoot sample scenarios  Press the „Compile all“ button, if necessary  Instantiate several turtle objects (CircleTurtle, SquareTurtle, FlowerTurtle and SpiralTurtle) and place somewhere in the world  Run the scenario by pressing „Run“  Observe the result

Introduction to Greenfoot Eueung Mulyana | kakihijau.googlepages.com 22 Scenario turtleGraphics (2)

Introduction to Greenfoot Eueung Mulyana | kakihijau.googlepages.com 23 Scenario ants (1)  Choose „Open...“ from the „Scenario“ menu and select the ants scenario from the Greenfoot sample scenarios  Press the „Compile all“ button, if necessary  By default (standard Greenfoot 1.3 distribution) you will have several objects, which are actually formed together as the World object is created; these objects are instances of the class AntHill and Food; other objects will be created „on-the-fly“  Run the scenario by pressing „Run“  Observe the result

Introduction to Greenfoot Eueung Mulyana | kakihijau.googlepages.com 24 Scenario ants (2)

Introduction to Greenfoot Eueung Mulyana | kakihijau.googlepages.com 25 Scenario lunarlander (1)  Choose „Open...“ from the „Scenario“ menu and select the lunarlander scenario from the Greenfoot sample scenarios  Press the „Compile all“ button, if necessary  By default you will have a Lander object, which is actually formed together as the World object is created  Now you are ready to play the game; run the scenario by pressing „Run“  The rocket thrust can be controlled by pressing the „down“ key on the keyboard

Introduction to Greenfoot Eueung Mulyana | kakihijau.googlepages.com 26 Scenario lunarlander (2)