Commit 4789650e authored by Johnny Jazeix's avatar Johnny Jazeix
Browse files

letter-in-word, play the audio of the word when select a good one

parent 6d5a84b4
......@@ -82,7 +82,7 @@ ActivityBase {
property alias parser: parser
property alias locale: background.locale
property alias ok: ok
property int remainingLife
property int remainingLife
property variant goodWord
property int goodWordIndex
property alias englishFallbackDialog: englishFallbackDialog
......
......@@ -156,12 +156,19 @@ Item {
}
}
function playWord() {
var locale = ApplicationInfo.getVoicesLocale(items.locale)
activity.audioVoices.append(
ApplicationInfo.getAudioFilePathForLocale(voice, locale))
}
function select() {
if(mouseActive && !successAnimation.running) {
if (Activity.checkWord(index)) {
successAnimation.restart();
particle.burst(30);
textItem.textFound = spelling.replace(RegExp(Activity.currentLetter, "g"), "<font color=\"#00FF00\">"+Activity.currentLetter+"</font>");
playWord();
}
else {
failureAnimation.restart()
......
......@@ -126,7 +126,8 @@ function initLevel() {
items.wordsModel.append({
"spelling": words[i].translatedTxt,
"imgurl": words[i].image,
"selected": false
"selected": false,
"voice": words[i].voice
});
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment