Download
slide1 n.
Skip this Video
Loading SlideShow in 5 Seconds..
Collision Detection PowerPoint Presentation
Download Presentation
Collision Detection

Collision Detection

147 Views Download Presentation
Download Presentation

Collision Detection

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. Collision Detection

  2. velocities of balls a boolean that is set to true when balls collide

  3. screen (view) limits initial positions of balls size of ball images

  4. ball.png

  5. in this example the balls overlap for three consecutive frames Rather than just checking to see if the two balls are overlapping we also need to see if they already collided and are still overlapping. Initially bunched = false. When balls collide bunched gets set to true and remains true until the two balls separate (i.e. no longer overlap). This is important to ensure that the "doh" sounds gets activated only once per collision.

  6. when a ball reaches a wall we simply reverse the sign of its velocity in the corresponding direction

  7. using Color.White hear leaves the sprite color unaffected. Using any other color will shade the sprite in the select color value. rectangle indicating the size of the image being used. location in the view of the object being drawn bitmap (or png) of the image being drawn

  8. DOH!