Ask the player a ‘yes’ or ‘no’ question which answered with the A or B button.


You ask a question which the player answers by pressing either the A or B button. If the player presses A, a true condition results. If the B button is pressed, the condition is false. You can include an optional subtitle as a second part of your question.


  • title: a string that has the text of your question.
  • subtitle: a string that is an optional second part of your question.


  • a boolean value that is true if the player pressed A in response to your question and false if the player pressed B.


Ask the player if they’re ready to play the next game level. If so, set the score to 0. Otherwise, finish the game.

if (game.ask("Ready to play?", "Next: advanced level")) {
} else {

See also

ask for string, ask for number