资 源 简 介
About
TinyShock is a very small cross-browser 2D Javascript game engine for use with the HTML5 canvas element.
Get TinyShock
Download the latest version from the download tab above, or alternatively get the latest version by checking it out through Mercurial (you must have Mercurial installed):
hg clone https://code.google.com/p/tinyshock
Why TinyShock?
TinyShock handles things like:
* Mouse position
* Keyboard events
* Image and sound loading
* Specified Beats-Per-Second.
Without you having to mess with complicated, non-cross-browser code. As an example, look at this standard Javascript code for finding the mouse position:
document.getElementById("screen").addEventListener("mousemove", function (event) { if (event.offsetX) { mouseX = event.offsetX; mouseY = event.offsetY; return; } else if (event.layerX || event.layerY) { mouseX = event.layerX;