Chapter 10 - Additional Scenario Ideas Bruce Chittenden.

Slides:



Advertisements
Similar presentations
Creative Computing. Comments on Assignments Everyone did very well Report writing needs more work Jumping scale Update first then draw.
Advertisements

Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and.
In this tutorial, we are going to create: A race car that the user can control with the arrow keys for direction and speed. A simulated road with a striped.
Breakout in Greenfoot Barb Ericson
Building Java Programs
Events Part III The event object. Learning Objectives By the end of this lecture, you should be able to: – Learn to use the hover() function – Work with.
Teaching with Greenfoot
Getting to know Greenfoot
Flocking and more.  NPC groups can move in cohesive groups not just independently ◦ Meadow of sheep grazing? ◦ Hunting flock of birds? ◦ Ants? Bees?
Chapter 8 - Creating Images and Sound Bruce Chittenden.
Chapter 2 - The First Program: Little Crab
Program: Little Crab Mr Gano.
1 CO Games Development 2 Week 22 Flocking Gareth Bellaby.
OBJECT-ORIENTED THINKING CHAPTER Topics  The Object-Oriented Metaphor  Object-Oriented Flocks of Birds –Boids by Craig W. Reynolds  Modularity.
Asteroids Games and Simulations O-O Programming in Java The Walker School The Walker School – Games and Simulations
Chapter 1 - Getting to know Greenfoot Bruce Chittenden.
Jochen Triesch, UC San Diego, 1 Emergence A system with simple but strongly interacting parts can often exhibit very intricate.
Wizard Game: Class-Level Variables in Alice By Jenna Hayes Under the direction of Professor Susan Rodger Duke University, July
GAME:IT Junior Bouncing Ball Objectives: Create Sprites Create Sounds Create Objects Create Room Program simple game.
Crowd Simulations Guest Instructor - Stephen J. Guy.
A Prezi presentation is like creating a mind map. It is created on a blank canvas and you decide where the information goes on this canvas.
SOURCE 2006 Presentation by Luke Arntson Game Programming Optimization.
Fruitful functions. Return values The built-in functions we have used, such as abs, pow, int, max, and range, have produced results. Calling each of these.
How to Prepare a PowerPoint Presentation Lawrence W. McAllister English Bridge Program – SFU NOTE: MAC is similar but not identical. So, if you use MAC,
AI & 2D Development COSC 315 Fall 2014 Bridget M. Blodgett.
How to Prepare a PowerPoint Presentation on Office 2003 (PC) by Lawrence W. McAllister English Bridge Program - SFU June 4, 2009 NOTE: MAC is similar but.
By Mr. Lee. Backgrounds The image that appears in the background (duh!). This might be a horizon, or clouds, trees and rainbows in the distance If you’re.
GAME:IT Bouncing Ball Objectives: Create Sprites Create Sounds Create Objects Create Room Program simple game.
Greenfoot. Getting Started Open the Greenfoot download site: Select Greenfoot
Semester Project: Air Hockey. Areas of Work Scene Graph and Texture Mapping Physics and Collision Detection Opponent AI Interface Design.
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.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Event Driven Programming, The.
Chapter 1 - Getting to know Greenfoot
Chapter 7 – Collision Detection: Asteroids
Learning Unity. Getting Unity
Microsoft® Small Basic Collision Detection Estimated time to complete this lesson: 1 hour.
Design Studies 20 ‘Show Off’ Project How to make a computer monitor In Google Sketchup By: Liam Jack.
ENGR-TS-2: The students will develop an understanding of how the design process is used to develop a technological system.
Study of Individual and Group responses of Mexican Free Tailed Bats Presented by Aruna Raghavan.
Chapter 9 – Additional Scenarios. Marbles Collision Detection The Marbles scenario does not use any of the built-in Greenfoot collision detection.
Lesson 2: Reading a program. Remember: from yesterday We learned about… Precise language is needed to program Actors and Classes Methods – step by step.
Methods for Multiplication Tutorial By: Melinda Hallock.
Chapter 2 – The Little Crab Program:. Little Crab Scenario Inheritance: The Arrows Denote Hierarchy Crab is an Animal Animal is an Actor Therefore, It.
Scott Keling and Gary Darby Escape From Skybase 17.
How to Prepare a PowerPoint Presentation Lawrence W. McAllister English Bridge Program – SFU NOTE: MAC is similar but not identical. So, if you use MAC,
Newton’s Lab Games and Simulations O-O Programming in Java.
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
Students: Yossi Turgeman Avi Deri Self-Stabilizing and Efficient Robust Uncertainty Management Instructor: Prof Michel Segal.
Chapter 4 - Finishing the Crab Game
Chapter 11: Scrolling with Greenfooot. What Is Scrolling? Scrolling is an important and often necessary concept in games. It can be used to: a)Convey.
Chapter 10: Creating Images and Sound
Chapter 4 - Finishing the Crab Game
MOM! Phineas and Ferb are … Aims:
Interlude 2 - The Greeps Competition
Background Shapes & Collision Resolution (Top-down and Side-scrolling)
Game Engines By James Tedder.
Barb Ericson Georgia Institute of Technology June 2007
Learn… Create… Program
Organizing Memory in Java
CIS 487/587 Bruce R. Maxim UM-Dearborn
CIS 488/588 Bruce R. Maxim UM-Dearborn
CIS 488/588 Bruce R. Maxim UM-Dearborn
Learn… Create… Program
Breakout in Greenfoot Barb Ericson
Download : to follow along.
Week 6: Time and triggers!
Learn… Create… Program
Learn… Create… Program
Nate Brunelle Today: Games
Bishopston Comprehensive School
Presentation transcript:

Chapter 10 - Additional Scenario Ideas Bruce Chittenden

10.1 Marbles

Marbles (continued)

Collision Detection The Marbles scenario does not use any of the built-in Greenfoot collision detection methods, since these all work on the rectangular actor images. The Marbles Scenario on the other hand are round and we need precise collision for this image.

haveHit(Marble marble ) /* * Check whether we have hit the given marble. We have hit it if its distance from us * (measured at the centre points) is less then our diameter. */ private boolean haveHit(Marble marble) { int dx = Math.abs (this.getX() - marble.getX()); int dy = Math.abs (this.getY() - marble.getY()); double distance = Math.sqrt(dx*dx+dy*dy); return distance < DIAMETER; }

Collision Detection this.getX()marble.getX() marble.getY() this.getY() dx dy distance = √ (dx 2 + dy 2 ) distance

10.2 Lifts

Lifts (continued)

The Lifts scenario is a simple elevator simulation. It shows several floors of a multistory building and three elevators moving up and down. People appear on the floors and press the call buttons and enter the elevators when they come. To finish this scenario the movement of people would have to be properly modeled in and out of the elevators.

10.3 Boids

Boids (continued)

Boids Algorithm The term “Boids” comes from a program developed in 1986 by Craig Reynolds that first implemented this flocking algorithm. In it each bird flies according to three rules:  Separation: Steer away from other birds if getting too close  Alignment: Steer toward the average heading of other birds in the vicinity  Cohesion: Steer to move toward the average position of other birds in the vicinity

10.4 Circles Click the Mouse to Create a Circle at That Location

Circles (continued)

Circles Nice to Look At The Circles scenario is a scenario that does not seem to have much of a purpose but is interesting to play with and nice to look at.

10.5 Explosion

Explosion (continued)

More Spectacular Explosion The Explosion scenario demonstrates how we can implement a more spectacular looking explosion effect. To achieve this effect, we have a Debris class that represents a part of the rock. When the rock explodes, we remove it from the world and place 40 pieces of debris in its place. See the tutorial video at

10.6 Breakout

Breakout (continued)

act Method Paddle /* * Act - do whatever the Paddle wants to do. This method is called whenever * the 'Act' or 'Run' button gets pressed in the environment. */ public void act() { if (Greenfoot.isKeyDown ("left")) { move(-9); } if (Greenfoot.isKeyDown ("right")) { move(9); } if (haveBall() && Greenfoot.isKeyDown ("space")) { releaseBall(); } }

10.7 Platform Jumper

Platform Jumper (continued)

act Method Pengu private void checkKeys() { if (Greenfoot.isKeyDown("left") ) { setImage("pengu-left.png"); moveLeft(); } if (Greenfoot.isKeyDown("right") ) { setImage("pengu-right.png"); moveRight(); } if (Greenfoot.isKeyDown("space") ) { if (onGround()) jump(); }

Platform Jumper A very common style game is a “platform” game. The player typically controls a game character that has to move from one are on the screen to another, while over coming various obstacles. This scenario demonstrates how an actor can move along the top of another actor (the penguin on top of the ground), and how jumping and falling might be implemented. See the tutorial video at

10.8 Wave

Wave (continued)

Wave One of the fascinating aspects of this scenario is how a fairly simple implementation achieves a quite sophisticated simulation of various aspects of wave propagation. In each act round, each bead simply moves toward the middle of its two neighbors.

10.9 Summary When you program in other environments, outside of Greenfoot, you will have to learn new skills and techniques, but everything you have learned using Greenfoot will be useful and applicable.