最新下载
谷歌浏览器插件IconFont检查器 自动获取当前页面使用到的iconfont库,预览、修改、使用
谷歌浏览器插件Color Picker for Chrome™ 在网页上拾取颜色 获取颜色HEX/RGB代码
24小时阅读排行榜
- 1 深度学习从零到精通文本分类的实践方法【教程】
- 2 量化交易从零到精通数据清洗的实践方法【教程】
- 3 Linux服务器磁盘告警频繁怎么办_容量规划与清理【教程】
- 4 LinuxShell条件判断怎么写_ifcase语法详解【指导】
- 5 Linux日志怎么分析_最佳实践总结助你快速突破【教程】
- 6 LinuxShell处理日志文件_批量分析技巧说明【教学】
- 7 Python表单自动填写_web驱动模拟操作技巧【指导】
- 8 Python基础-列表操作(2):列表的遍历和数字列表
- 9 Linux文件权限怎么看_最佳实践总结助你快速突破【技巧】
- 10 LinuxShell脚本安全如何保证_权限与校验策略【指导】
- 11 Python画折线图柱状图_常见图表绘制技巧【技巧】
- 12 Python自动监控目录变化并进行分类归档的脚本逻辑分析【教学】
- 13 Linux网络丢包怎么排查_链路与网卡分析方法【教程】
- 14 Linux多网卡路由怎么配置_策略路由实战说明【技巧】
- 15 Linux Git安装与使用教程_Linux管理版本库完整步骤
最新教程
-
- Node.js 教程
- 14406 2025-08-28
-
- CSS3 教程
- 1541368 2025-08-27
-
- Rust 教程
- 22090 2025-08-27
-
- Vue 教程
- 24593 2025-08-22
-
- PostgreSQL 教程
- 21279 2025-08-21
-
- Git 教程
- 8381 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();
}
};
