简体   繁体   中英

How to make animation using Javascript

I want to add something to my project that is similar to a Mortal Kombat intro, and it will be called "Sonya vs Scorpion". I tried to create it using Flash CS5. There is an animation going from left side to middle, another one from right side to middle, and "Vs" in the center.

I researched Javascript, but I don't know how to animate it... I can prepare it with Flash, but it makes website the slower. Can someone help me? Thanks.

You can use Canvas for this purpose. Make a canvas element and put there 2 sprites (images): Scorpion and Sonya. With canvas API you will be able to animate it using JavaScript.

Check this link, it should help you a lot. There is a lot of examples. http://www.williammalone.com/articles/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM