This is something that really confused me, and because it is a very common early project for many people, I thought it would be useful to show how to bounce stuff off the walls, starting from simple geometry, through to physics with collisions, rotation, etc.
While the physics lab provided with Codea is cool and shows off a lot of stuff, I think it makes physics look a lot harder than it really is, because you don’t need any of the debugDraw code in many projects, and I was very confused what all the code did, and what I actually needed. So I’ve tried to create demos with minimal complexity and code.
So here it is, four demos in one: http://pastebin.com/embed_js.php?i=UBrJVYT4
Comments, improvements and ideas welcome.