Problem:
Hi, I’m looking to modify the Catching Birds template.
Currently, the game ends when time runs out, but what I would like to do is that when the score reaches 100, the game ends and changes scene.
Unfortunately I don’t have any knowledge in javascript…
Change the line that reads 'doc.score >= 7 ’ to the value of your choice.
Replace the contents of the timelineEventHandler function with this code:
function startTimer(duration) {
var time = duration;
function timer() {
doc.getElement("div_timer").setText(time);
time++;
if (doc.score >= 7) {
clearInterval(timeinterval);
doc.showNextScene();
}
};
timer();
var timeinterval = setInterval(timer, 1000);
}
startTimer(0);