Introduction to Programming with Greenfoot: Object-Oriented Programming in Java with Games and Simulations

Paperback
from $0.00

Author: Michael Kolling

ISBN-10: 0136037534

ISBN-13: 9780136037538

Category: Game Programming

Introduction to Programming with Greenfoot Object-Oriented Programming in Java™ with Games and Simulations\ Michael Kolling\ Written by Greenfoot creator and BlueJ developer, Michael Kolling, Introduction to Programming with Greenfoot uses Greenfoot, an award-winning educational programming environment, to teach standard Java programming.\ Greenfoot uses simulations and games to teach object-oriented concepts and principles in a fun, easily accessible manner. Greenfoot bridges the gap to...

Search in google:

Introduction to Programming with Greenfoot: Object-Oriented Programming in Java with games and Simulations is ideal for introductory courses in Java Programming or Introduction to Computer Science.The only textbook to teach Java programming using Greenfoot—this is “Serious Fun.” Programming doesn’t have to be dry and boring. This book teaches Java programming in an interactive and engaging way that is technically relevant, pedagogically sound, and highly motivational for students. Using the Greenfoot environment, and an extensive collection of compelling example projects, students are given a unique, graphical framework in which to learn programming.

Introduction 1Chapter 1 Getting to know Greenfoot 31.1 Getting started 31.2 Objects and classes 41.3 Interacting with objects 61.4 Return types 71.5 Parameters 81.6 Greenfoot execution 91.7 A second example 101.8 Understanding the class diagram 101.9 Playing with Asteroids 121.10 Source code 131.11 Summary 15Chapter 2 The first program: Little Crab 162.1 The Little Crab scenario 162.2 Making the crab move 182.3 Turning 192.4 Dealing with screen edges 212.5 Summary of programming techniques 25Chapter 3 Improving the Crab–more sophisticated programming 273.1 Adding random behavior 273.2 Adding worms 303.3 Eating worms 323.4 Creating new methods 333.5 Adding a Lobster 363.6 Keyboard control 363.7 Ending the game 383.8 Adding sound 403.9 Summary of programming techniques 42Chapter 4 Finishing the crab game 434.1 Adding objects automatically 434.2 Creating new objects 454.3 Animating images 464.4 Greenfoot images 474.5 Instance variables (fields) 484.6 Assignment 494.7 Using actor constructors 504.8 Alternating the images 524.9 The if/else statement 534.10 Counting worms 534.11 More ideas 554.12 Summary of programming techniques 56Interlude 1 Sharing your scenarios 57I1.1 Exporting your scenario 57I1.2 Export to application 57I1.3 Export to a web page 58I1.4 Publishing on the Greenfoot Gallery 59Chapter 5 Making music: An on-screen piano 615.1 Animating the key 625.2 Producing the sound 655.3 Abstraction: Creating multiple keys 665.4 Building the piano 685.5 Using loops: The while loop 695.6 Using arrays 725.7 Summary of programming techniques 76Chapter 6 Interacting objects: Newton’s Lab 786.1 The starting point: Newton’s Lab 796.2 Helper classes: SmoothMover and Vector 806.3 The existing Body class 836.4 First extension: Creating movement 856.5 Using Java library classes 866.6 Adding gravitational force 876.7 The List type 906.8 The for-each loop 916.9 Applying gravity 936.10 Trying it out 956.11 Gravity and music 976.12 Summary of programming techniques 99Chapter 7 Collision detection: Asteroids 1017.1 Investigation: What is there? 1027.2 Painting stars 1037.3 Turning 1067.4 Flying forward 1077.5 Colliding with asteroids 1097.6 Casting 1127.7 Adding fire power: The proton wave 1157.8 Growing the wave 1157.9 Interacting with objects in range 1197.10 Further development 1217.11 Summary of programming techniques 122Interlude 2 The Greeps competition 123I2.1 How to get started 124I2.2 Programming your Greeps 125I2.3 Running the competition 126I2.4 Technicalities 126Chapter 8 Creating images and sound 1278.1 Preparation 1278.2 Working with sound 1298.3 Sound recording and editing 1308.4 Sound file formats and file sizes 1318.5 Working with images 1338.6 Image files and file formats 1338.7 Drawing images 1358.8 Combining images files and dynamic drawing 1378.9 Summary 139Chapter 9 Simulations 1419.1 Foxes and rabbits 1429.2 Ants 1459.3 Collecting food 1469.4 Setting up the world 1499.5 Adding pheromones 1499.6 Path forming 1529.7 Summary 152Chapter 10 Additional scenario ideas 15410.1 Marbles 15410.2 Lifts 15510.3 Boids 15610.4 Circles 15710.5 Explosion 15810.6 Breakout 15910.7 Platform jumper 16010.8 Wave 16110.9 Summary 162AppendixA Installing Greenfoot 163B Greenfoot API 165C Collision detection 169D Some Java details 175Index 185