Commit 6bcc3128 authored by Manuel Tondeur's avatar Manuel Tondeur Committed by Johnny Jazeix

gnumch, init level after bonus fades out

parent a255ebff
...@@ -48,9 +48,8 @@ ActivityBase { ...@@ -48,9 +48,8 @@ ActivityBase {
// Set the cell invisible if it's the correct answer. // Set the cell invisible if it's the correct answer.
if (Activity.isAnswerCorrect(muncher.index)) { if (Activity.isAnswerCorrect(muncher.index)) {
modelCells.get(muncher.index).show = false modelCells.get(muncher.index).show = false
var levelDone = gridPart.isLevelDone() if (gridPart.isLevelDone()) {
if (levelDone) { stopLevel();
nextLevel()
} }
} else { } else {
modelCells.get(muncher.index).show = false modelCells.get(muncher.index).show = false
...@@ -74,14 +73,18 @@ ActivityBase { ...@@ -74,14 +73,18 @@ ActivityBase {
Activity.initLevel(); Activity.initLevel();
operator = Activity._operator; operator = Activity._operator;
topPanel.goal = Activity.getGoal(); topPanel.goal = Activity.getGoal();
monsters.destroyAll(); stopLevel();
spawningMonsters.stop();
timerActivateWarn.stop();
if (Activity._currentLevel % 6 !== 0) { if (Activity._currentLevel % 6 !== 0) {
spawningMonsters.restart(); spawningMonsters.restart();
} }
} }
function stopLevel() {
monsters.destroyAll();
spawningMonsters.stop();
timerActivateWarn.stop();
}
anchors.fill: parent anchors.fill: parent
color: "#ABCDEF" color: "#ABCDEF"
signal start signal start
...@@ -384,6 +387,10 @@ ActivityBase { ...@@ -384,6 +387,10 @@ ActivityBase {
Bonus { Bonus {
id: bonus id: bonus
onStop: {
parent.nextLevel();
}
} }
} }
} }
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