O'Reilly logo

The Essential Guide to Physics for Flash Games, Animation, and Simulations by Adrian Dobre, Dev Ramtal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Bouncing off inclined walls

Things get significantly more complicated if the wall on which the ball bounces is inclined at some angle to the horizontal or vertical. The same steps apply as in the case of a horizontal or vertical wall, but they are now a bit more complex to implement. Different approaches could be taken here. One common approach, described in Keith Peters's book, Foundation ActionScript 3.0 Animation, is to perform a coordinate rotation to make the wall horizontal, do the bouncing, and then rotate the coordinate system back. This is a perfectly good way to do it, and we refer you to that book for more details of the procedure. For our present purposes, because we are using vectors, we have devised an alternative method that exploits ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required