This script shows a simple bouncing game written with
Canvas in HTML5. The following techniques are adopted:
- Canvas for graphics.
- Detect mouse movement.
- Collection detection.
Note that the middle of the bar is supposed to be at the mouse pointer, however the final output in this blog page is not. It may be due to the margin added to the document by blogger.
Output
When the file is viewed in a browser such as Chrome or Firefox, it appears as below.
Source Code
No comments:
Post a Comment