- 88 Views
- Uploaded on
- Presentation posted in: General

Collision Detection

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Collision Detection

Barclays Apps Teaching Course - 2013

- Collision detection typically refers to the computational problem of detecting the intersection of – from two or more objects
- Interactive games use collision detection
- Can be done by Objects or Using Images

- Point and Rectangle
- If you want to know if a point is in a rectangle – say a button

w

(x,y)

h

(px,py)

- You know the X and Y of the point = px and py
- You know the Location X and Y of the Rectangle and also the Width and Height = x,y ,w,h
- Inside =((px>=x)And(px<=(x+w-1))And(py>=y)And(py<=(y+h-1)))

- Images are a series of numbers in a file
- Each number is a pixel value – colour

1100, 1222,22112,22112,3443,222322,444,3223,21222,4332

- Similar approach – but search through the image and detect what the colour is

w

(x,y)

(px,py)