31 lines
625 B
Plaintext
31 lines
625 B
Plaintext
|
this.draw_layer = 5;
|
||
|
var sp = this.add_component(component.sprite);
|
||
|
sp.path = "yellowbird-midflap.png";
|
||
|
|
||
|
this.physupdate = function() {
|
||
|
Game.camera.pos = [this.pos.x,0];
|
||
|
this.angle = this.velocity.y / 6000;
|
||
|
};
|
||
|
|
||
|
var flap = true;
|
||
|
|
||
|
this.inputs = {};
|
||
|
this.inputs.space = function()
|
||
|
{
|
||
|
this.velocity = [this.velocity.x,0];
|
||
|
this.pulse([0,400]);
|
||
|
this.cry("wing.qoa");
|
||
|
}
|
||
|
|
||
|
this.collide = function(hit)
|
||
|
{
|
||
|
if (hit.obj.ur === 'pipe' || hit.obj.ur === 'ground') {
|
||
|
flap = false;
|
||
|
this.circle2d.enabled = false;
|
||
|
this.velocity = [0,0];
|
||
|
player[0].uncontrol(this);
|
||
|
game.gameover();
|
||
|
this.cry("hit.qoa");
|
||
|
}
|
||
|
}
|