HTML and CSS Reference
In-Depth Information
jump: function() {
if(this.p.standing >= 0) {
this.p.vy = -this.p.speed * 1.4;
this.p.standing = -1;
}
},
tile: function(collision) {
if(collision.direction == 'bottom') {
this.p.standing = 5;
}
},
step: function(dt) {
var p = this.p;
if(p.animation == 'fire_right' || p.animation == 'fire_left') {
if(this.p.standing > 0) {
this.p.vx = 0;
}
} else {
if(this.p.standing < 0) {
if(p.vx) {
p.direction = p.vx > 0 ? 'right' : 'left';
}
this.play('fall_' + p.direction,1);
}
if(Q.inputs['right']) {
this.play('run_right');
p.vx = p.speed;
p.direction = 'right';
} else if(Q.inputs['left']) {
this.play('run_left');
p.vx = -p.speed;
p.direction = 'left';
} else {
p.vx = 0;
this.play('stand_' + p.direction);
}
this.p.standing~DH;
}
this._super(dt);
}
});
Search WWH ::




Custom Search