At the moment the pool ball is bouncing off the limits of the window and travelling through the cushions. Alter this so that the ball appears to bounce off the cushions instead of the window. This is a simply case of altering the max / min values in the Update method.

Two options:
• Measure the size of the cushions in terms of pixels and scale these values based on the original image size and the scaled size
• Trial and error

Have a go at the first option (open the table image in Photoshop and look at the sizes of the cushion).

Note that we’re not trying to accurately create cushion physics – it looks pretty good by just inverting the direction values.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.