of Kent A practical introduction to Greenfoot David Barnes Lecturer in Computer Science University of.

Slides:



Advertisements
Similar presentations
BlueJ first, obviously; but what next, when, and why? Ian Utting.
Advertisements

Getting your Feet Green
Teaching with Greenfoot
Further abstraction techniques Abstract classes and interfaces 5.0.
Games and Simulations O-O Programming in Java The Walker School
Program: Little Crab Mr Gano.
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.
Designing classes How to write classes in a way that they are easily understandable, maintainable and reusable 4.0.
Well-behaved objects 4.0 Testing. 2 Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling Main concepts to.
CM10134-CM50147 Programming I Basic Programming in Java Marina De Vos.
Objects First with Java A Practical Introduction using BlueJ
String Concatenation (operator overloading) 3.0.
Understanding class definitions Looking inside classes 3.0.
Object interaction Creating cooperating objects 3.0.
Systems Analysis & Design Sixth Edition Systems Analysis & Design Sixth Edition Toolkit Part 5.
Object Interaction 1 Creating cooperating objects.
CO320 Introduction to Object- Oriented Programming Michael Kölling 3.0.
Further abstraction techniques Abstract classes and interfaces 3.0.
5.0 Objects First with Java A Practical Introduction using BlueJ David J. Barnes Michael Kölling.
INTRODUCTION TO SCRATCH. About Me Resources Scratch Website Learn Scratch Washington-Lee Computer.
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.
11 Games and Content Session 4.1. Session Overview  Show how games are made up of program code and content  Find out about the content management system.
GREENFOOT CLUB RESOURCES Brian Cullen – Rossett School
Introduction to Scratch!
5.0 Objects First with Java A Practical Introduction using BlueJ Introduction to Computer Science I Instructor: Allyson Anderson.
Greenfoot. Getting Started Open the Greenfoot download site: Select Greenfoot
Objects First With Java A Practical Introduction Using BlueJ Designing applications 1.0.
Chapter 8 – Mouse Input, Images and Sound. Chapter 8 - Content In contrast to previous chapters, we will not build a complete scenario in this chapter.
Object Oriented Programming April 13, Problem Description “ …Wombats are allowed to have different directions and number of eaten leaves, move,
Chapter 1 - Getting to know Greenfoot
Java is an object oriented programming language In this model of programming all entities are objects that have methods and fields Methods perform tasks.
Well-behaved objects Main concepts to be covered Testing Debugging Test automation Writing for maintainability Objects First with Java - A Practical.
Designing classes How to write classes in a way that they are easily understandable, maintainable and reusable 5.0.
Lecture 4. Greenfoot 1 Pablo Romero, Department of Informatics Greenfoot Programming simulations and games in Java.
Greenfoot Game Programming Club.
Designing applications Main concepts to be covered Discovering classes CRC cards Designing interfaces Patterns Objects First with Java - A Practical.
5.0 Objects First with Java A Practical Introduction using BlueJ David J. Barnes Michael Kölling.
Kakihijau.googlepages.com Introduction To Greenfoot Part-1.
Final Review. From ArrayLists to Arrays The ArrayList : used to organize a list of objects –It is a class in the Java API –the ArrayList class uses an.
Techniques for presenting content
Kakihijau.googlepages.com Introduction To Greenfoot Part-2.
Objects First With Java A Practical Introduction Using BlueJ Well-behaved objects 2.1.
Introduction To Greenfoot
Objects First With Java A Practical Introduction Using BlueJ Designing classes How to write classes in a way that they are easily understandable, maintainable.
1 COS 260 DAY 21 Tony Gauvin. 2 Agenda Questions? 8 th Mini Quiz corrected –Good results 9 Th Mini Quiz Today –40 min covering Chap 9 Assignment 5 Due.
Well-behaved objects Main concepts to be covered Testing Debugging Test automation Writing for maintainability Objects First with Java - A Practical.
1 COS 260 DAY 22 Tony Gauvin. 2 Agenda Questions? 9 th Mini Quiz corrected –Good results Assignment 5 Not corrected yet Assignment 6 Posted (one more)
Kakihijau.googlepages.com Introduction To Greenfoot Part-3.
Newton’s Lab Games and Simulations O-O Programming in Java.
Enhancing JavaScript Using Application Programming Interfaces (APIs), Lecture #3.
Introducing Scratch Learning resources for the implementation of the scenario
Chapter 4 - Finishing the Crab Game
Chapter 4 - Finishing the Crab Game
Chapter 3 – Improving the Crab Game
Introduction To Greenfoot
Version 2.
COS 260 DAY 16 Tony Gauvin.
COS 260 DAY 2 Tony Gauvin.
Physics-based simulation for visual computing applications
Defining Class Member Data/characteristics
Games and Simulations O-O Programming in Java The Walker School
Creating cooperating objects
Objects First with Java A Practical Introduction using BlueJ
Greenfoot November 8, 2009.
COS 260 DAY 23 Tony Gauvin.
Objects First with Java A Practical Introduction using BlueJ
Further abstraction techniques
Poul Henriksen Computing Laboratory University of Kent
Presentation transcript:

of Kent A practical introduction to Greenfoot David Barnes Lecturer in Computer Science University of Kent

of Kent Overview Introducing object-orientation BlueJ The Greenfoot environment Greenfoot scenarios Practical application

of Kent Introducing object-orientation Building early understanding of key concepts is crucial: –Class –Object –State –Behaviour Hard to do without tool support – e.g. visualisation.

of Kent BlueJ IDE designed specifically for the teaching of introductory object- orientation. Developed by Michael Kölling. Good visualisation of key concepts. Interactivity brings these concepts to life. Typically used at u/g level.

of Kent Greenfoot An environment and framework that supports World+Actor scenarios. Developed by Michael, and Poul Henriksen. Provides visually engaging and concrete experiences for pre-University students. Built on top of BlueJ.

of Kent A few Greenfoot scenarios Wombats Ants Lifts Lunar lander

of Kent Practical application The framework API The crab world, by Michael Kölling. –Basic movement. –Actor interaction. –Simulation controls. –Key strokes. –Sound. –Image manipulation.

of Kent little-crab You will use the little-crab scenario in the crabworld folder. (Try to ignore the 2, 3, 4 and 5 folders which are cribs!) We start by using methods inherited from Animal to add movement, edge- detection and turning.

of Kent Worms Add a new subclass of Animal. No behaviour required. Add random turning to the Crab: –getRandomNumber in Greenfoot Add Worm detection to the Crab: –getOneObjectAtOffset in Actor –removeObject in World

of Kent Lobster Add Lobster as a subclass of Animal. –Copy Crab’s functionality. –Make it hunt crabs rather than worms. Stop the simulation when a crab is eaten: –stopSimulation in Greenfoot Variation: stop when the last crab is eaten.

of Kent Adding sound Play different sounds when crabs and worms are eaten (see the sounds folder): –playSound in Greenfoot Setup an initial population: –Use the constructor of CrabWorld. Change images as the crab moves: –setImage in Actor.

of Kent Other capabilities Detecting key presses: –isKeyDown in Greenfoot. Actor inspection. Interactive method invocation. Interactive movement: –setLocation in Actor. Linking actor interaction (plane scenario).

of Kent Review Greenfoot provides a rich environment and framework for scenario creation. Teachers can build scenarios that are attractive and interesting. An intermediate implementation layer provides an appropriate abstraction for target groups of students.