Leslie
Leslie
正则、new Date()、new Error() 。 date会返回一个字符串 正则和错误会返回一个空对象
### 预览  完整项目预览----[预览地址](http://lingyouhuiquanla.com/lover/); ### 粒子效果原理 在canvas中,可以通过`getImageData()`方法来获取像素数据。 ```javascript ctx.fillStyle = '#ff0000'; ctx.fillRect(0, 0, 1, 1); const imageData = ctx.getImageData(0, 0, 1, 1); ``` `imageData`有三个属性: * `data`:数组,包含了像素信息,每个像素会有四个长度,如`[255,0,0,255, ... ,255,127,0,255]`,分别代表该像素的RGBA值。 * `width`:`imageData`对象的宽。...
**多代码,慎读!!!** ### 预览  完整项目预览----[预览地址](http://lingyouhuiquanla.com/lover/); ### 属性设计 **烟花状态**:烟花应有三个状态: 1. 升空 2. 等待炸裂 3. 炸裂后 **烟花**:发射点(x, y),爆炸点(xEnd, yEnd),升空后等待炸裂时间(wait),炸裂后微粒个数(count),烟花半径(radius) **烟花炸裂后微粒**:自身位置(x, y),自身大小(size),自身速度(rate),最大烟花半径(radius)。 **config**:为全局变量,以及控制参数,包括画布宽高,设定烟花属性等。 ### 设定全局变量 ```javascript const config = { width: 360, height:...
in dot.js line 50 and 51 this.p.x -= ((dx / d) * e); and you written e = this.e * d; before so the results is this.px -= (dx *...