We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
请问这个 1.function movbulb(){ with (this) { if(ec < 20){ if(Math.abs(x0 - xm) < 100 && Math.abs(y0 - ym) < 100){ xx = (xm - x0) / 8; yy = (ym - y0) / 8; ec++; } } xx *= 0.99; yy *= 0.99; x0 = Math.round(x0 + Math.cos(y0 / 15) * p) + xx; y0+= yy - v; if(y0 < -h * 2 || x0 < -w * 2 || x0 > nx + w * 2){ y0 = ny + N + h * 2; x0 = nx/2-100 + Math.random() * 100; ec = 0; } obj.style.top = y0 - h; obj.style.left = x0 - w; } } 2. this.v = 1 + Math.round((80 / h) * Math.random()); this.p = 1 + Math.round((w / 8) * Math.random()); 请问大佬实现这个盒子上下左右浮动核心代码是什么原理,核心代码看不懂
The text was updated successfully, but these errors were encountered:
大佬可以注释下吗?
Sorry, something went wrong.
No branches or pull requests
请问这个
1.function movbulb(){
with (this) {
if(ec < 20){
if(Math.abs(x0 - xm) < 100 && Math.abs(y0 - ym) < 100){
xx = (xm - x0) / 8;
yy = (ym - y0) / 8;
ec++;
}
}
xx *= 0.99;
yy *= 0.99;
x0 = Math.round(x0 + Math.cos(y0 / 15) * p) + xx;
y0+= yy - v;
if(y0 < -h * 2 || x0 < -w * 2 || x0 > nx + w * 2){
y0 = ny + N + h * 2;
x0 = nx/2-100 + Math.random() * 100;
ec = 0;
}
obj.style.top = y0 - h;
obj.style.left = x0 - w;
}
}
2.
this.v = 1 + Math.round((80 / h) * Math.random());
this.p = 1 + Math.round((w / 8) * Math.random());
请问大佬实现这个盒子上下左右浮动核心代码是什么原理,核心代码看不懂
The text was updated successfully, but these errors were encountered: