Press _____ to flap!

var lessonText = ' '; var mainState = { preload: function() { game.load.image('background', 'assets/background.png'); game.load.image('ground', 'assets/ground.png'); game.load.spritesheet('bird', 'assets/bird.png', 34, 24); game.load.image('gamestart', 'assets/start-button.png'); //Audio game.load.audio('pipehit', 'assets/pipe-hit.wav'); game.load.audio('groundhit', 'assets/ground-hit.wav'); type: function() { this.bird.animations.play('flap'); this.ground.autoScroll(-200, 0); var practice = this.practice; var lessonArray = lessonText.toUpperCase().split(''); var bird = this.bird; var that = this; game.input.keyboard.onUpCallback = function(e) { if (that.starti == true) { that.starti = false; this.i = undefined; } this.i = ++this.i || 0; var char = String.fromCharCode(e.keyCode); if (lessonArray[this.i] == char) { if (this.i == 0) that.startPlaying(); bird.body.velocity.y = -95; practice.text += char; } else this.i--; } },