(game, x, y, index)
| 358 | /***********************************************************************************/ |
| 359 | |
| 360 | var Bird = function(game, x, y, index) { |
| 361 | Phaser.Sprite.call(this, game, x, y, 'imgBird'); |
| 362 | |
| 363 | this.index = index; |
| 364 | this.anchor.setTo(0.5); |
| 365 | |
| 366 | // add flap animation and start to play it |
| 367 | var i=index*2; |
| 368 | this.animations.add('flap', [i, i+1]); |
| 369 | this.animations.play('flap', 8, true); |
| 370 | |
| 371 | // enable physics on the bird |
| 372 | this.game.physics.arcade.enableBody(this); |
| 373 | }; |
| 374 | |
| 375 | Bird.prototype = Object.create(Phaser.Sprite.prototype); |
| 376 | Bird.prototype.constructor = Bird; |
nothing calls this directly
no outgoing calls
no test coverage detected