CRE Programming Club Class #9 Robert Eckstein and Robert Heard.

Slides:



Advertisements
Similar presentations
EZ Grade Pro Becky Koss French & Spanish Teacher Lake-Lehman Sr. High School.
Advertisements

First of all – lets look at the windows you are going to use. At the top you have a toolbar, with all your various tools you can use when customising your.
SCRATCH Lesson Two – Interactive Concepts Using Sensing, Operators, and Variables.
WATER Teacher Page.
Working with images and scenes CS 5010 Program Design Paradigms “Bootcamp” Lesson 2.5 TexPoint fonts used in EMF. Read the TexPoint manual before you delete.
Collision Detection CSCE /60 What is Collision Detection?  Given two geometric objects, determine if they overlap.  Typically, at least one of.
Collision Detection and Resolution Zhi Yuan Course: Introduction to Game Development 11/28/
Go through this show in OpenOffice Impress by using the right scrollbar or clicking individual slide thumbnails on the left side. This hands-on demo is.
 What we're going to do is break up a circle into little pieces, and then reassemble it into a shape that we know the area formula for...  Maybe you're.
Drawing Objects with Illustrator 1.Start a new image in RGB mode. 2.Size 1024 X Unit = pixels 4.Go to View > Show Grid to turn on the grid. 5.Go.
A Christmas Scratch game
Week 14 - Monday.  What did we talk about last time?  Bounding volume/bounding volume intersections.
Tutorial Video basic skills basic skills Next page -->
Welcome to the CRE Programming Club! Robert Eckstein and Robert Heard.
In.  This presentation will only make sense if you view it in presentation mode (hit F5). If you don’t do that there will be multiple slides that are.
CS 450: Computer Graphics PIXEL AdDRESSING AND OBJECT GEOMETRY
Hear and see your contacts with Office Communicator Conferencing using Communicator 2007 Communicator 2007 is designed to support the way you usually communicate.
CRE Programming Club - Class 7 Robert Eckstein and Robert Heard.
Some Cool Tricks.  We can consider the screen as high school graph paper.  Each sprite or object is located somewhere in the coordinate system.
Week 13 - Friday.  What did we talk about last time?  Ray/sphere intersection  Ray/box intersection  Slabs method  Line segment/box overlap test.
Introduction to Communicator 2007 Manage your contacts Communication is all about making contact, and the heart of Communicator 2007 is your Contact List.
> 1 Diagrams in Word Faculty of Health Alan Grace.
Welcome to the CRE Programming Club! Robert Eckstein and Robert Heard.
Hi, Learning Skills Students! This is Slide 1 of your Power Point Instruction for this class. After reading each slide, make sure you: 1.Follow the instructions.
Multitouch and Collision Detection MOBILE SOFTWARE DEVELOPMENT.
CSE 113 Introduction to Computer Programming Lecture slides for Week 12 Monday, November 14 th, 2011 Instructor: Scott Settembre.
Creating Art With Simple Shapes By carefully implementing simple shapes to an HTML canvas we can create useful graphics. With enough time, lines, ellipses.
Sketchup For 3D Design, Part 3. Directions: Choose one of the classroom 3D objects. Measure all sides with a ruler. Re-create this object in Sketchup,
Microsoft® Small Basic Collision Detection Estimated time to complete this lesson: 1 hour.
Game Maker Terminology
 When you receive a new you will be shown a highlighted in yellow box where your can be found  To open your new just double click.
This is what we want to draw Extrude Mirror Round Edges.
Loops & Graphics IP 10 Mr. Mellesmoen Recall Earlier we wrote a program listing numbers from 1 – 24 i=1 start: TextWindow.WriteLine(i) i=i+1 If.
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
Game Maker – Getting Started What is Game Maker?.
Design Studies 20 ‘Show Off’ Project How to make a computer monitor In Google Sketchup By: Liam Jack.
Collision Detection And Response Jae Chun KyungSoo Im Chau Vo Hoang Vu.
CRE Programming Club - Class 2 Robert Eckstein and Robert Heard.
CRE Programming Club Class 8 Robert Eckstein and Robert Heard.
CRE Programming Club - Class 5 Robert Eckstein and Robert Heard.
Animating Line by Line (two ways). Use multiple slides -make copies of a complete slide -leave last slide complete -delete last line from the 2 nd to.
Methods for Multiplication Tutorial By: Melinda Hallock.
How to find the intersection of two lines graphically using the TI-83
screen shots Emma Jarman. Adding attachments What is an attachment? An attachment is an that has a file attached to it. The file could be.
First of all – lets look at the window’s you are going to use. At the top you have a toolbar, with all your various tools you can use when customising.
How to Draw a Basic 3-D Box Using one-Point Perspective
Background Shapes & Collision Resolution (Top-down and Side-scrolling)
Creating Vector Graphics
Intro & Point-to-Box, Circle-to-Circle, Point-to-Circle
Collision Detection Box-to-Box.
Have You Got The Angle? Hi boys and Girls! Today, we are going to learn about Angles. Angles are everywhere! And they have different types. At the.
Identifying Quadrilaterals
Review Slides for Final on May 30th
Paddle Ball! We will begin creating, in steps, a video game similar to ‘brick breaker’ or ‘pong’, were we can move paddles to hit a bouncing ball. I hope.
Learning to program with Logo
TermiGator Ebrahem Hamdan University of Florida
What do we now know about number systems?
Conditional Loops.
LearnZillion Notes: --This is your hook. Start with a question to draw the student in. We want that student saying, “huh, how do you do X?” Try to be specific.
Fraction Fun.
Go to =>
Topic 1: Problem Solving
Here are four triangles. What do all of these triangles have in common
Pictures in 3-D flip book (Intermediate)
Week 1 - Introduction and Objects
LearnZillion Notes: --This is your hook. Start with a question to draw the student in. We want that student saying, “huh, how do you do X?” Try to be specific.
Chapter 9 Using Decisions to
Please Do Now / Dec. 2, 15 Log into computer Go to
Op Art Directions.
Presentation transcript:

CRE Programming Club Class #9 Robert Eckstein and Robert Heard

Let’s Look at some Homework JGT020-6 (Andy Friedrich) BDJ016-0 (Ashley Hartenstein) BXX981 (Arnav Chopra)

Video -FA

Collision Detection Two objects are said to “collide” if they come in contact with each other. Collision detection is an essential aspect of nearly all video games. Algorithms help to detect the collision. For the most part, you can just find someone else’s algorithm and copy it!

Collision Detection Import LLW706 Have fun with this “game” for a little bit. Enter an angle between 0 and 360 (0 is up, angles increase clockwise) and a distance in pixels. See if you can get the turtle to collide with the CRE Logo.

Source Code Hunting Look through the source code for LLW706. See if you can find where the code that checks for the collision detection is… Look for a place where the X and Y position of the turtle is compared to the right, left, top, and bottom position of the graphic.

If Turtle.x > x and Turtle.x < x + 93 and Turtle.y > y and Turtle.y < y + 96 Then ‘ There is a collision between logo/turtle! EndIf Line 52!

Bounding Boxes When working with collision detection, it helps to think of shapes or graphics as being surrounded by a “shrinkwrapped rectangle.” This is called a bounding box. Here is a blue bounding box around an early Mario.

Bounding Boxes Bounding Boxes can also be very complex, and are used in more modern 3D games as well!

Why Use a Bounding Box? Because it’s quick and easy to compute when things run into each other…. just figure out if the rectangles are touching!

Works With Circles Too To figure out if something is colliding with a circle, just see if the distance between some point and the center of the circle is less than the radius. Two circles? Just see if the distance between the centers is less than the two radius values added together. You’ll need to be familiar with the Pythagoreon Therom.

Are BBs Perfect? No! But for simple games, it’s generally good enough. Sub DoBoxesIntersect box1Left = box1X box1Top = box1Y box1Bottom = box1Y + box1Height box1Right = box1X + box1Width box2Left = box2X box2Top = box2Y box2Bottom = box2Y + box2Height box2Right = box2X + box2Width

Here’s the Rest of It… If (box1Bottom box2Bottom) Or (box1Left > box2Right) Or (box1Right < box2Left) Then Shapes.HideShape(intersect) Else Shapes.ShowShape(intersect) EndIf EndSub

Import QSP227 Run this program. Use the arrow keys to move one of the rectangles around. Note that when it collides with the other rectangle, a message appears at the bottom. USE THIS ALGORITHM IN YOUR OWN PROGRAMS!

Why Does This Work? Talk To Your Teachers! See if you can figure out why that algorithm works. (HINT: Look at the intersecting rectangle made by the two squares on slide 12.) It’s much more efficient than checking to see if any of the four corners of one rectangle are inside the boundaries of another rectangle.

Homework Continue working on your state machine. This time, when in the PLAY_GAME state, don’t kick it into the third state unless there is a collision of some sort. Add multiple shapes. Be creative! Have fun! me with questions…

Next Time... No class next week due to STAAR tests. We’ll get back together the following week and really start cranking out some game code.