<body>
<canvas class = "canvas"></canvas>
<script>
var S = {
start: function(){
Draw.init();
//Draw.drawRadial();
Shape.switchShape(Shape.drawHeart());
Draw.loop(function(){
Shape.render();
});
}
};
Point = function(args){
this.x = args.x;
this.y = args.y;
this.z = args.z;
this.a = args.a;
};
Dot = function(x,y){
this.p = new Point({
x:x,
y:y,
z:5,
a:1,
h:0
});
this.e = 0.07;
this.s = true;
this.t = this.clone();
this.q = [];
};
Dot.prototype = {
clone: function(){
return new Point({
x: this.x,
y: this.y,
z: this.z,
a: this.a,
h: this.h
});
},
move: function(p){
this.q.push(p);
},
moveTowards: function(n){
var dx = this.p.x - n.x,
dy = this.p.y - n.y,
dl = Math.sqrt(dx * dx &#
js形成心形效果
最新推荐文章于 2024-05-19 08:45:33 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)