flappybat/bird/bird.jso

30 lines
630 B
Plaintext
Raw Normal View History

2024-03-03 17:45:08 -06:00
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;
};
2024-03-07 12:23:02 -06:00
this.flap = function()
2024-03-03 17:45:08 -06:00
{
this.velocity = [this.velocity.x,0];
this.pulse([0,400]);
this.cry("wing.qoa");
}
2024-03-07 12:23:02 -06:00
this.inputs = {};
this.inputs.space = function() { this.flap(); }
2024-03-03 17:45:08 -06:00
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");
}
}