最新下载
jQuery点击文字滚动Scrollocue插件
24小时阅读排行榜
- 1 用wamp能让php浏览器运行吗_wamp配置php步骤【解答】
- 2 php语言怎么学_php语言学习路径与资源推荐【学习】
- 3 PHP怎么接收XML字符串_PHP接收XML字符串的技巧【指南】
- 4 php 怎么往数组里添加数据库_php数组添数据库数据查询结果追加法【教程】
- 5 php怎么取字符串里的数组_php字符串取数组json_decode与正则匹配法【教程】
- 6 php怎么直接打印二维数组_PHP直接输出打印二维数组
- 7 php把对象转换为数组方法_php对象转数组操作详解【教程】
- 8 php数组求平均值计算方法_php数组数值平均技巧详解【指南】
- 9 PHP网站设计怎样实现用户注册功能_PHP用户注册实现步骤【功能】
- 10 php之laravel中自定义模板命令
- 11 加密解密怎样触发php代码执行_加密解密触发php代码执行方法【步骤】
- 12 php创建类对象数组对象_php对象数组实例化定义技巧【教程】
- 13 php怎么判断多维数组是否为空_PHP判断多维数组是否为空
- 14 php 怎么去除二维数组中相同的部分_php二维数组去重技巧【步骤】
- 15 网页嵌入php链接失败域名解析错误怎么办_网页嵌入php链接失败域名检查法【步骤】
最新教程
-
- Node.js 教程
- 14146 2025-08-28
-
- CSS3 教程
- 1540748 2025-08-27
-
- Rust 教程
- 21851 2025-08-27
-
- Vue 教程
- 24365 2025-08-22
-
- PostgreSQL 教程
- 21077 2025-08-21
-
- Git 教程
- 8304 2025-08-21
代码片段:
this.update = function(i) {
this.rotation += this.velocity.rotate * this.timescale;
this.position.x +=
Math.cos(this.velocity.phi) * this.velocity.length * this.timescale;
this.position.y +=
Math.sin(this.velocity.phi) * this.velocity.length * this.timescale;
this.position.x +=
Math.cos(this.gravity.phi) * this.gravity.length * this.timescale;
this.position.y +=
Math.sin(this.gravity.phi) * this.gravity.length * this.timescale;
this.velocity.phi += this.accelerate.phi.change * this.timescale;
(this.velocity.phi > this.accelerate.phi.max ||
this.velocity.phi < this.accelerate.phi.min) &&
(this.accelerate.phi.change = -this.accelerate.phi.change);
this.velocity.length *= this.accelerate.friction;
if (this.position.y > this.ground) {
var ctx = this.vfx;
var position = this.position;
var range = this.edge;
var main = this.main;
[...new Array(this.edge)].map(
() =>
main.makeRock({
position: { x: position.x, y: position.y },
base: range
}) ||
LightFlare(
ctx,
position.x + Math.random() * 10 * range - 5 * range,
position.y + Math.random() * 6 * range - 3 * range,
range * Math.random() * 30 + 30
)
);
this.main.meteors.splice(i, 1);
this.main.makeMeteor();
}
};
