Build simple game interaction by HTML5 base on KineticJS JavaScript Library

DEMO

HTML5 is powerful on web game, in this article we will create a page include simple interaction which is controlling the catoon man to walk up,down,right and left by arrow key.

First, we need to load a javascript library named “KineticJS”, it’s very strong framework for HTML5 canvas interaction. You can get it from  http://www.kineticjs.com/

Code as below:

You also need to prepare a catton man image include every  motion like below:

and a map background:

Add some css code for the canvas:

Now we can focus on javascript coding.

Tagged with: ,
Posted in HTML5, Javascript

Leave a Reply

Categories

Related Posts