flappybat/bird/bird.jso

30 lines
630 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;
};
this.flap = function()
{
this.velocity = [this.velocity.x,0];
this.pulse([0,400]);
this.cry("wing.qoa");
}
this.inputs = {};
this.inputs.space = function() { this.flap(); }
this.collide = function(hit)
{
if (hit.obj.ur === 'pipe' || hit.obj.ur === 'ground') {
this.circle2d.enabled = false;
this.velocity = [0,0];
player[0].uncontrol(this);
game.gameover();
this.cry("hit.qoa");
}
}