this.standing

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);

时间: 2024-08-02 00:02:52

this.standing的相关文章

Where Are You Standing?

/*********************************************************************** * Where Are You Standing? * 说明: * 简单的画一下目前所接触到的东西网络结构 * * 2016-7-23 深圳 南山平山村 曾剑锋 **********************************************************************/

GCJ 2015Q(Standing Ovation-贪心)

Problem It's opening night at the opera, and your friend is the prima donna (the lead female singer). You will not be in the audience, but you want to make sure she receives a standing ovation -- with every audience member standing up and clapping th

[USACO17DEC]Standing Out from the Herd

[USACO17DEC]Standing Out from the Herd 题目描述 Just like humans, cows often appreciate feeling they are unique in some way. Since Farmer John's cows all come from the same breed and look quite similar, they want to measure uniqueness in their names. Eac

standing

2bc*cosA=b^2+c^2-a^2 #include<cstdio> #include<cstring> #include<iostream> #include<cmath> #include<algorithm> using namespace std; const double pi=3.1415926535898;//我不明白他为什么会卡精度 int t; double x1,y,r1,x2,y2,r2,s,a,b,c,k,m,w,p

Codeforces 124A - The number of positions

题目链接:http://codeforces.com/problemset/problem/124/A Petr stands in line of n people, but he doesn't know exactly which position he occupies. He can say that there are no less than a people standing in front of him and no more than b people standing b

Codeforces Round #393 (Div. 2)

A. Petr and a calendar time limit per test:2 seconds memory limit per test:256 megabytes input:standard input output:standard output Petr wants to make a calendar for current month. For this purpose he draws a table in which columns correspond to wee

POJ3048 Max Factor

本文版权归ljh2000和博客园共有,欢迎转载,但须保留此声明,并给出原文链接,谢谢合作. 本文作者:ljh2000作者博客:http://www.cnblogs.com/ljh2000-jump/转载请注明出处,侵权必究,保留最终解释权!   Description To improve the organization of his farm, Farmer John labels each of his N (1 <= N <= 5,000) cows with a distinct s

清北学堂 站军姿

/*2bc*cosA=b^2+c^2-a^2 模拟计算 50分*/ #include<iostream> #include<cstdio> #include<cmath> using namespace std; const double t=3.1415926535898; int n; double a,b,c,x,y,z,x2,y2,z2,s,k,m,w,p; int main () { freopen ("standing.in","

IaaS, PaaS和SaaS公司都做些什么

原文链接:http://www.leiphone.com/news/201406/iaas-paas-and-saas.html "云服务"现在已经快成了一个家喻户晓的词了.如果你不知道PaaS, IaaS 和SaaS的区别,那么也没啥,因为很多人确实不知道.(做了半年SaaS的我也是在介绍项目时候才听到这个SaaS,他们都把这个读作"萨斯",我的第一反应是当年那个病毒..) "云"其实是互联网的一个隐喻,"云计算"其实就是使