this.standing
来源:互联网 发布:域名和url的区别 编辑:程序博客网 时间:2024/06/06 05:07
this.standing水平走的时候是true,纵向有速度是false,斜面轻微纵向速度也true
var accel = this.standing ? this.accelG: this.accelA;
if (this.currentAnim === this.anims.run && !this.sounds.walk.looping) {
this.sounds.walk.loop();
}
if (this.currentAnim !== this.anims.run && this.sounds.walk.looping) {
this.sounds.walk.stopLoop();
}
if (this.standing && ig.input.pressed('jump')) {
this.sounds.jump.play();
}
if (ig.input.state('left')) {
this.accel.x = -accel;
this.flip = true;
} else if (ig.input.state('right')) {
this.accel.x = accel;
this.flip = false;
} else if (!this.standing) {
this.vel.x *= 0.9;
this.accel.x *= 0.9;
if (Math.abs(this.vel.x) < 5) {
this.vel.x = 0;
}
if (Math.abs(this.accel.x) < 5) {
this.accel.x = 0;
}
} else {
this.accel.x = 0;
}
if (this.jumpMax && this.standing) {
this.jumpMax = false;
}
if (ig.input.pressed('jump') && this.standing) {
this.jumpMax = false;
this.standing = false;
Delay.delay(this, 0.35,
function() {
this.jumpMax = true;
});
}
if (!this.jumpMax && !this.standing) {
this.vel.y = -this.jump / 1.5;
}
if (!ig.input.state('jump')) {
this.jumpMax = true;
}
if (this.vel.x !== 0 && (ig.input.state('right') || ig.input.state('left'))) {
this.currentAnim = this.anims.run;
} else {
this.currentAnim = this.anims.idle;
}
if (!this.standing && this.vel.y < 0) {
this.currentAnim = this.anims.jump;
} else if (!this.standing && this.vel.y > 0) {
this.currentAnim = this.anims.fall;
}
this.currentAnim.flip.x = this.flip;
ig.Entity.prototype.update.call(this);
0 0
- this.standing
- final standing
- qb standing
- Standing out from the competition
- Long standing or sedentary easily cured illness
- google code jam 2015 A Standing Ovation
- GCJ 2015Q(Standing Ovation-贪心)
- Standing on shoulders of ture Giant
- 读书笔记—— Under Standing Linux Network Internals(3)
- Google Code Jam 2015 Qualification Round: Problem A. Standing Ovation
- Google Code jam Qualification Round 2015 --- Problem A. Standing Ovation
- Gym 101341M Last Man Standing 模拟|贪心
- this
- this
- this
- this
- this
- this
- 记一次计算机网络工程实验(2) 配置交换机
- Spring3自定义环境配置 <beans profile="">
- Nginx配置文件nginx.conf中文详解
- 第十一周 哈夫曼树
- spring+mybatis配置多数据源总结,重点是动态加载数据源,支持动态切换
- this.standing
- HTML5 postMessage 跨域交换数据
- 多线程下载资源
- Spring Boot基础|使用nohup运行jar文件
- MediaTek_ApSoC_SDK_4320_20150414编译问题
- 开始学习Unity
- java基础篇
- redis 基础
- 使用OpenGL在Unity中画一个框