Wombats Creating Games with Greenfoot The Walker School – Games and Simulations - 2010.

Slides:



Advertisements
Similar presentations
Create a Simple Game in Scratch
Advertisements

Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
Getting started with MPLAB Launch MPLAB Set Toolbar as in the next slide by clicking the leftmost icon Open a new Source file by choosing [FILE][NEW] Type.
Create a Simple Game in Scratch
Problem Solving with Data Structures using Java: A Multimedia Approach Chapter 14: Using an Existing Simulation Package Download greenfoot and install.
Teaching with Greenfoot
Getting to know Greenfoot
Games and Simulations O-O Programming in Java The Walker School
Animation Mrs. C. Furman. Animation  We can animate our crab by switching the image between two pictures.  crab.png and crab2.png.
of Kent A practical introduction to Greenfoot David Barnes Lecturer in Computer Science University of.
Chapter 2 - The First Program: Little Crab
Program: Little Crab Mr Gano.
Asteroids Games and Simulations O-O Programming in Java The Walker School The Walker School – Games and Simulations
Greenfoot Asteroids Mrs. C. Furman August 16, 2010.
Chapter 1 - Getting to know Greenfoot Bruce Chittenden.
Chapter 1 - Getting to know Greenfoot Acknowledgement: Michael Kolling & Bruce Chittenden.
Games and Simulations O-O Programming in Java The Walker School
GAME:IT Junior Bouncing Ball Objectives: Create Sprites Create Sounds Create Objects Create Room Program simple game.
01-Intro-Object-Oriented-Prog-Alice1 Barb Ericson Georgia Institute of Technology Aug 2009 Introduction to Object-Oriented Programming in Alice.
Scratch the Cat. Object Oriented Programing Writing computer programs Based on Objects Instead of Actions Based on Data Instead of Logic.
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.
MrsBillinghurst. net A2 Computing A2 Computing Projects Game Animation in Pascal.
Making a Timer in Alice.
CIS 205—Web Design & Development Flash Chapter 1 Getting Started with Adobe Flash CS3.
Karel J Robot An introduction to BlueJ and Object- Oriented Programming.
Problem Solving with Data Structures using Java: A Multimedia Approach Chapter 14: Using an Existing Simulation Package.
Greenfoot. Getting Started Open the Greenfoot download site: Select Greenfoot
Presenter- Deborah Coker  Advantages of having a site  Features you may want to have on your site  Menus, Tabs, and Ribbons  Creating.
Fall 2005 Using FrontPage to Enhance Blackboard - Darek Sady1 Using FrontPage to Enhance Blackboard 1.Introduction 2.Starting FrontPage 3.Creating Documents.
Chapter 1 - Getting to know Greenfoot
2015 CSE/EGR Summer Camps 1 Computer Science Concepts 1. What is an algorithm? 2. Binary information coding 3. Programming concepts via Scratch Designed.
L.O. To understand programming code, to navigate and add objects into Kodu. Start Menu  Primary Applications  ICT  Kodu.
Lecture 4. Greenfoot 1 Pablo Romero, Department of Informatics Greenfoot Programming simulations and games in Java.
Greenfoot Game Programming Club.
® Microsoft Access 2010 Tutorial 10 Automating Tasks with Macros.
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-1.
Introduction to OOP in VB.NET using Robots ACSE Conference, Nov 2004 Michael Devoy Monsignor Doyle C.S.S., Cambridge
Create a Halloween Computer Game in Scratch Stephanie Smullen and Dawn Ellis Barb Ericson October 2008.
Kakihijau.googlepages.com Introduction To Greenfoot Part-2.
Introduction To Greenfoot
Introduction to Computer Programming - Project 2 Intro to Digital Technology.
BDE tutorial By Deborah Nelson Duke University Under the direction of Professor Susan Rodger July 13, 2008.
Aquarium Lab Series Developed by Alyce BradyAlyce Brady of Kalamazoo CollegeKalamazoo College.
Using Alice.  Alice is visual  Alice is object-oriented (some might say object- based)  Alice eliminates the need to debug syntax errors  Alice introduces.
Chapter 2 – The Little Crab Program:. Little Crab Scenario Inheritance: The Arrows Denote Hierarchy Crab is an Animal Animal is an Actor Therefore, It.
1 CSC 221: Computer Programming I Fall 2009 Introduction to programming in Scratch  animation sprites  motion, control & sensing  costume changes 
Adding and Eating Worms Mrs. C. Furman August 23, 2010.
Kakihijau.googlepages.com Introduction To Greenfoot Part-3.
Newton’s Lab Games and Simulations O-O Programming in Java.
Georgia Institute of Technology More on Creating Classes Barb Ericson Georgia Institute of Technology June 2006.
Introducing Scratch Learning resources for the implementation of the scenario
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
Create a Halloween Computer Game in Scratch
Scratch for Interactivity
Introduction To Greenfoot
Introduction to Object-oriented Program Design
Creating Games with Greenfoot
Version 2.
The Little Crab Scenario
Problem Solving with Data Structures using Java: A Multimedia Approach
Games and Simulations O-O Programming in Java The Walker School
Introduction to Object-Oriented Programming in Alice
Methods, Data and Data Types
Greenfoot November 8, 2009.
More on Creating Classes
Tutorial 10 Automating Tasks with Macros
Bishopston Comprehensive School
Presentation transcript:

Wombats Creating Games with Greenfoot The Walker School – Games and Simulations

What is Greenfoot? A free environment that makes it easy to create 2D animations, simulations, and games –While teaching object- oriented concepts in Java –Built on top of BlueJ –Created at the Un. of Kent in England and Deakin University The Walker School – Games and Simulations

Watch – Java Programming with Greenfoot (Part I) The Walker School – Games and Simulations

Greenfoot Resources Web site – Scenarios – s/index.htmlhttp:// s/index.html Tutorial – ial.htmlhttp:// ial.html Book: Introduction to Programming with Greenfoot by Michael Kölling The Walker School – Games and Simulations

Getting Started To start Greenfoot click on greenfoot.exe Click on Project in the menu –Choose Open –Pick the wombats scenario –It starts by showing an empty WombatWorld Which is a 2D grid of cells The Walker School – Games and Simulations

Adding Objects to the World Right click on Wombat in the class display to see a pop-up menu –Create a Wombat by selecting new Wombat() A picture of a wombat will appear attached to the cursor –Click in the world to place the wombat –Shift-click to place more than one object Class Display The Walker School – Games and Simulations

Add Leaves Add several leaves to the world –Right click on Leaf in the class display Hold down the shift key –Click in the grid to place each leaf The Walker School – Games and Simulations

Greenfoot Objects There are two basic types of things in Greenfoot –Worlds and Actors Other objects are children (subclassses) of these –Inherit properties and behaviors from parent (superclass) –Worlds hold actors a stage for actors –Actors can act They may move They may stay where they are The Walker School – Games and Simulations

Run the Simulation Click on act to execute one simulation time step –Act one time Click on run to have it continuously execute time steps –Keep acting till you Click on pause to stop Click on reset to start over –With a new WombatWorld The Walker School – Games and Simulations Execution Controls

What Happened? Questions –How did the wombats move? –Did they eat any leaves? –Did the leaves move? –What happened when a wombat reached the edge of the world? If you don’t know the answer to any of these questions place more wombats and/or leaves in the world and run again –Or click on act to see things in slow motion The Walker School – Games and Simulations

The Wombat Scenario To get information on any scenario –Click on the Project Information button In top right corner above the class display –Read the displayed documentation Click close when done The Walker School – Games and Simulations

Actor Methods You can see and execute all methods that an actor knows how to do –By right clicking on an actor in the grid –Select a method to execute it You can invoke inherited methods as well The Walker School – Games and Simulations

Return Types The Walker School – Games and Simulations Tells us what the method returns when we invoke it. Methods with “void” do not return a value.

World Methods Right click near the title of the world –To show the world menu –Select populate() This will add wombats and leaves to the world –Then click on run What happens? –Do all the leaves get eaten? The Walker School – Games and Simulations

Class Diagrams Superclasses contain methods that give functionality to subclasses. Abstract Classes are needed but don’t create actors. Subclasses inherit the methods of its superclass. The Walker School – Games and Simulations Subclass Superclass Abstract Class

Changing Wombat Behavior Left click on the Wombat class –To show the code for the Wombat class –Read the act method Modify it to turn left a random number of times (0-3) if it can’t move and isn’t eating a leaf –Create a turnRandom method and call it instead –Use Greenfoot.getRandomN umber(4) The Walker School – Games and Simulations

Attack the Problem Establish a turnRandom() method Establish a variable “turns” that will hold the number of turns. Establish a loop to count the number of turns Establish a counter, set it to zero, count up by 1 The Walker School – Games and Simulations

Possible Solution – Part I The Walker School – Games and Simulations

Attack the Problem – Part II Use a conditional statement to say that if the wombat is pointed in a specific direction, then change that direction randomly The Walker School – Games and Simulations

Possible Solution – Part II The Walker School – Games and Simulations

Changing Actors The Walker School – Games and Simulations Changing Actors 1.Right click on the actor’s class 2.Choose “Set Image” 3.Choose the image from the library 4.Compile the program

Adding Actors from the Greenfoot Image Library The Walker School – Games and Simulations /images.html Adding Actors 1.Navigate to the website. 2.Right click and download the image to your folder on the school’s network drive. 3.Save it to your images folder for the project. 4.Open the project. 5.Right click on the actor’s class. 6.Choose “Set Image”. 7.The image should appear in the left pane because you added it to the project image folder. 8.Choose the image. 9.Compile the program.

Open Challenge (Coding Movement) Study the habits of how a particular character moves in real life. How could you code these different types of movements? Look at movement in other games or check out how to create movement in video tutorials. The Walker School – Games and Simulations Videos are also on YouTube.com