Skip to content

烟花特效 #67

@Dream4ever

Description

@Dream4ever

参考资料

HTML5 canvas and javascript fireworks tutorial

代码调整

上面 CodePen 的代码已经非常好了,根据自己的需求,对其中几处代码进行了调整。

  // 烟花发射的时间间隔,单位为毫秒,默认为80,时间有点长,改成40,效果就比较嗨了
  timerTotal = 40,

  // 烟花轨迹的长度,由默认的3改为6,更好看一些
  this.coordinateCount = 6;

  // 将下面两处代码注释掉,就不会显示烟花爆炸位置了
  this.targetRadius = 0;

  // // cycle the circle target indicator radius
  // if (this.targetRadius < 8) {
  //   this.targetRadius += 0.3;
  // } else {
  //   this.targetRadius = 1;
  // }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions