Search code examples
javascripthtmlflashadobemovieclip

What's the HTML5 equivalent to Flash MovieClip


I use to make simple games with Adobe Flash, particularly using Flash movieclips for my game objects. I could, say, import a character's animation frames into a movieclip's timeline, and then in ActionScript I could set the character's mode which would determine which of the movieclip's frames are looped to animate the character. For instance, if the user presses the arrow keys, it would loop the "walk" or "run" animation sequence, and if the user released the arrow keys, the movieclip would be instructed to loop the "idle" animation sequence instead.

How can I do that with HTML5?


Solution

  • if you want to know about native solution, so you can use Canvas API combined with some JS listeners and animation tricks like this ones

    But if you want to use Libraries/Frameworks, you can use PhaserJS or MelonJS they are very useful. For my personal recommendation, I suggest using cocos2D framework, it's very nice one.