Unit 3, Lesson 27 Bubble 2

@gellis1,

math.abs is the code used to find the absolute value. In this case, I used it to find out how many pixels away the airplane sprite was from the pointer. This way whether the x value of the airplane was greater than the x value of the pointer or vice versa, it doesn’t matter. We just now how close it is.

When a collision occurs using bounceOff, the velocity of the ball is automatically increased, but you can use code to slow the velocity down. You may also want to consider which collision block to use. Here’s a post that talks about bounceOff in more depth.

I would suggest he play around with it and see what he can do on his own, but if he gets stuck with some code that isn’t working, check back in and we’ll try to help.

Mike