Barb Ericson Georgia Institute of Technology June 2007

Slides:



Advertisements
Similar presentations
GAME:IT Junior Paddle Ball Objectives: Review skills from Introduction Create a background Add simple object control (up and down) Add how to create a.
Advertisements

Create a Simple Game in Scratch
SimpleGameInAlice1 Barb Ericson Georgia Institute of Technology June 2008 Creating a Simple Game in Alice.
Create a Simple Game in Scratch
Scratch is a Visual Programming Language
Breakout in Greenfoot Barb Ericson
Chapter 10 - Additional Scenario Ideas Bruce Chittenden.
Harry Potter Scratch Game
Adventures in Animation Harry Potter Game Pranali Choubal Kunal Shaw Barb Ericson Dec 2007.
Chapter 2 - The First Program: Little Crab
Program: Little Crab Mr Gano.
Rules for Classroom Play. Setup 1. Remove blue ACTION cards from the Observatory deck 2. Shuffle both decks well and set Volcano deck to one side 3. Deal.
A Christmas Scratch game
Pulling out a common superclass Barb Ericson Georgia Tech.
Extending the Pong Example Barb Ericson Georgia Tech June 2011.
Fell View Computer Club StarLogo TNG – Session Two.
GAME:IT Junior Bouncing Ball Objectives: Create Sprites Create Sounds Create Objects Create Room Program simple game.
Creating pong in scratch Learning objectives: To learn how to program Sensing via colour and sprite proximity O:\ICT\ks3\scratch\scratch Exercises\Creating.
Game Design Creating a game called PING Phase 3: Steps for building basic game.
GAME:IT Bouncing Ball Objectives: Create Sprites Create Sounds Create Objects Create Room Program simple game.
VIDEO GAME PROGRAMMING Video Game Programming Level One – Breakout INSTRUCTOR Big Dan Teague TEACHER’S ASSISTANT Delmar O'Donnell.
KeyListener and Keyboard Events Just as we can implement listeners to handle mouse events, we can do the same for keyboard events (keypresses) –to implement.
©Robomatter – Distribution or copying without permission is prohibited. 3B STEM Computer Science 1 ©Robomatter – Distribution or copying without permission.
Art 315 Lecture 5 Dr. J. Parker AB 606. Last time … We wrote our first program. We used a tool called GameMaker. The program we wrote causes a ball to.
Adding and Subtracting Integers. Vocabulary Negative sign –Left side of number line Positive sign –Right side of number line Operation –Action which produces.
Programming Video Games
Creating a Simple Game in Scratch Barb Ericson Georgia Tech June 2008.
EGR 115 Introduction to Computing for Engineers 3D animation in MATLAB Monday 17 Nov 2014 EGR 115 Introduction to Computing for Engineers.
Chapter 9 – Additional Scenarios. Marbles Collision Detection The Marbles scenario does not use any of the built-in Greenfoot collision detection.
CreatingClasses-SlideShow-part31 Creating Classes part 3 Barb Ericson Georgia Institute of Technology Dec 2009.
Create a Halloween Computer Game in Scratch Stephanie Smullen and Dawn Ellis Barb Ericson October 2008.
Lesson 2: Reading a program. Remember: from yesterday We learned about… Precise language is needed to program Actors and Classes Methods – step by step.
Today we are learning to: Understand how actions and events control our game. Completing the catch the clown game – making a room – adding music Gather.
Game Project 1 Homage to Pong. Project Rules: The primary project is Pong, the design and development of which will be discussed in detail here. If you.
Today we are learning to: Understand how flow charts are used to design games Add events to our objects to control stuff in our game – (Using the user.
Integer Football Welcome to Integer Football!
Georgia Institute of Technology More on Creating Classes part 3 Barb Ericson Georgia Institute of Technology Nov 2005.
Chapter 2 – The Little Crab Program:. Little Crab Scenario Inheritance: The Arrows Denote Hierarchy Crab is an Animal Animal is an Actor Therefore, It.
Creating Scenarios In Greenfoot. Greenfoot Scenarios are made up of: Greenfoot Scenarios are made up of: A World class. A World class. Actor classes.
GAME:IT Junior Paddle Ball Objectives: Review skills from Introduction Create a background Add simple object control (up and down) Add how to create a.
GAME:IT Paddle Ball Objectives: Review skills from Introduction Create a background Add simple object control (up and down) Add how to create a simple.
Newton’s Lab Games and Simulations O-O Programming in Java.
Creating a Simple Game in Scratch Barb Ericson Georgia Tech May 2009.
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
Chapter 4 - Finishing the Crab Game
Energy and Motion Kinetic and Potential Energy. Energy We use the idea of energy in many ways in everyday life. - When fuel supplies run low we have an.
Sound and more Animations
Create a Halloween Computer Game in Scratch
Breakout 3D Jeremy Quick.
Stage 1 Before you start to script the game you need to create the assets. Stage 1 will help you to create your background image, score zones, paddles.
Game Maker Intro to Programming Game Maker Pop Quiz (Both Groups)
Chapter 3 – Improving the Crab Game
Racquetball Rules.
Animation & Games Module
Version 2.
Basketball main rules To know the rules… Click here!
The One Where You Scratch
Go to =>
Problem Solving with Data Structures using Java: A Multimedia Approach
Games and Simulations O-O Programming in Java The Walker School
Breakout in Greenfoot Barb Ericson
Barb Ericson Georgia Institute of Technology Oct 2005
Game Maker Intro to Programming Game Maker Pop Quiz (Both Groups)
Building a Game in Scratch
Creating a Simple Game in Scratch
WJEC GCSE Computer Science
So you want to be a Game Designer
This Photo by Unknown Author is licensed under CC BY-NC-ND
Presentation transcript:

Barb Ericson Georgia Institute of Technology June 2007 Breakout in Greenfoot Barb Ericson Georgia Institute of Technology June 2007 Georgia Institute of Technology

Georgia Institute of Technology The Breakout Game Open Breakout-Start There are Bricks, a Message that says we are starting with Ball 1, a Ball, and a Paddle But if you click on act or run nothing happens Georgia Institute of Technology

Georgia Institute of Technology Game Rules Use the left and right arrow keys to move the paddle Use the paddle to hit the ball into the bricks to get rid of them Get rid of all the bricks to win the game The ball will bounce off most of the walls, paddle, and bricks You get up to three balls to use If you still have bricks after using 3 balls you lose If a ball hits the bottom wall it is removed and new ball added Georgia Institute of Technology

Georgia Institute of Technology Moving the Paddle Check if the left key is down Greenfoot.isKeyDown("left") if it is move left setLocation(getX() – moveAmount, y); else check if the right key is down Greenfoot.isKeyDown("right") if it is move right setLocation(getX() + moveAmount,y); Georgia Institute of Technology

Georgia Institute of Technology The Ball's Act Method Move the ball Check if hit any actors If hit an actor and that actor isn't the message Bounce off the object Check if the object was a brick if it was a brick remove the brick from the world and have the world check if the player won (no more bricks) Check if at any walls Bounce off top or side walls If at bottom wall remove ball and create a new one Georgia Institute of Technology

Georgia Institute of Technology Move the Ball The ball's y velocity is 3 but is a field velY The ball's x velocity should be a random value between 1 and 3 or -1 to -3 set in the constructor velX To move the ball add velX to the current x (getX) add velY to the current y (getY) Use setLocation(x,y); Georgia Institute of Technology

Checking if hit any Actors Get an actor (object of the class Actor) that intersects with this one Actor actor = this.getOneIntersectingObject(Actor.class); If the ball did hit an actor and it isn't the message (object of the Message class) if (actor != null && !(actor instanceof Message)) Georgia Institute of Technology

Bounce the Ball off an Actor The actor must be a paddle or a brick (if it isn't a message) So negate velY velY = -velY; Georgia Institute of Technology

Georgia Institute of Technology If the Ball hit a Brick Check using if (actor instanceof Brick) If the ball did hit a brick remove it world.removeObject(actor); check if won world.checkIfWon(); Georgia Institute of Technology

Georgia Institute of Technology Checking Walls If the ball hit the left wall if (getX() - radius <= 0) negate velX else If the ball hit the right wall if (getX() + radius >= BreakoutWorld.WIDTH) else If the ball hit the top wall else if (getY() - radius <= 0) negate velY Georgia Institute of Technology

Georgia Institute of Technology Checking Bottom Wall else if (getY() + radius >= BreakoutWorld.HEIGHT) remove the current ball from the world world.removeObject(this); add a new ball to the world world.newBall(); this also checks for the end of the game Georgia Institute of Technology

Georgia Institute of Technology Additional Ideas Add sounds bounce sound and win or lose sounds If hit at edge of paddle then bounce in x as well as y Speed up the velocity after each 7th hit double the x velocity See the documentation for the Greenfoot classes http://www.greenfoot.org/doc/javadoc/ Georgia Institute of Technology