In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "how to use HTML5 to make fireworks effect". In daily operation, I believe many people have doubts about how to use HTML5 to make fireworks effect. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "how to use HTML5 to make fireworks effect". Next, please follow the editor to study!
The principle is simple. Just write a fireworks class and debris class, instantiate and let it fly, and then after reaching a certain point, set the dead property of the fireworks object to true, then instantiate a certain number of debris objects, and give the debris objects a random target point to reach, and then let all the debris objects fly over.
[fireworks]
XML/HTML Code copies content to the clipboard
VarBoom=function {/ / pyrotechnic object (x _ rer _ cmeno _ boomia _ shape)
This.booms=? []
This.x=?x
This.y=? (canvas.height+r)
This.r=?r
This.c=?c
This.shape=?shape? | |? false
This.boomArea=?boomArea
This.theta=0
This.dead=false
This.ba=parseInt (getRandom)
}
Boom.prototype=? {
_ paint:function () {
Ctx.save ()
Ctx.beginPath ()
Ctx.arc (this.x,this.y,this.r,0,2*Math.PI)
Ctx.fillStyle=this.c
Ctx.fill ()
Ctx.restore ()
}
_ move:function () {
Vardx=this.boomArea.x?-?this.x?,dy=this.boomArea.y?-?this.y
Thisthis.x=?this.x+dx*0.01
Thisthis.y=?this.y+dy*0.01
If (Math.abs (dx))
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.