The program is written in ActionScript which compiles to Flash.
There are four classes:
Sets up the program, controls keyboard input, does graphics for explosion.
Does physics of the ball, controls gravity, and bouncing against walls which loose a perportion of the energy.
Collision detection when the ball hits the target. A rectangle with the balls current and previous positions
as corners is used to detect hitting the point.
Simple class just to display the background.
The code was created using the open source FlashDevelop IDE
and the open source Adobe Flex SDK.
Code inspired by BlockGame of Chris DeLeon www.GameDevLessons.com.
Creative Commons image from flickr.
Add a comment/link: