simplex-noise实现canvas火环效果代码

代码语言:html

所属分类:其他

代码描述:simplex-noise实现canvas火环效果代码

代码标签: simplex-noise canvas 火环

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >
<head>
  <meta charset="UTF-8">
<style>
    body, html {
  margin: 0;
}

canvas {
  display: block;
  cursor: pointer;
}
</style>

</head>
<body>
<!-- partial:index.partial.html -->
<canvas id="canvas"></canvas>
<!-- partial -->
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/simplex-noise.min.js"></script>
  <script >
      /*
  Johan Karlsson
  https://github.com/DonKarlssonSan/vectory
  MIT License, see Details View

*/

"use strict";

class Vector {
  constructor(x, y) {
    this.x = x;
    this.y = y;
  }

  add(v) {
    return new Vector(
    this.x + v.x,
    this.y + v.y);
  }

  addTo(v) {
    this.x += v.x;
    this.y += v.y;
    return this;
  }

  sub(v) {
    return new Vector(
    this.x - v.x,
    this.y - v.y);
  }

  subFrom(v.........完整代码请登录后点击上方下载按钮下载查看

网友评论0