Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Check the case that the tick is longer than our remaining time
var edt = Math.min(dt, dur);
this.set('duration', dur - edt);
var rate = this.get('rate');
this.set('value', this.get('value') + rate * edt);
if(this.func) {
this.func.apply(this.obj, [this.get('value') + rate * edt]);
}
}
// Otherwise change is complete
else {
// Let anyone who wants to know that this change has finished
events.trigger(this, 'Completed', this);
// Then kill it
this.kill();
}
},
nextQuestion: function() {
if(this.current < this.questions.length - 1) {
// Advance to next question
events.trigger(this, 'beforeNextQuestion');
// Remove the current question only if this is not a first question
if(this.current > -1) {
this.removeChild({child: this.questions[this.current]});
}
this.current += 1;
setTimeout(this.nextQuestionCallback.bind(this), QuestionSet.QDelay);
}
else {
var that = this;
setTimeout(function() {events.trigger(that, 'endOfSet')}, QuestionSet.QDelay);
}
},
exec: function() {
events.trigger(eventRelay, 'CallFunctionEvent', this.func, this.params);
}
});
update: function(dt) {
if(PNode.cameraZ >= this.get('zCoordinate') && !this.fired) {
this.fired = true;
events.trigger(this, 'changeSelector', this.selector);
}
Intermission.superclass.update.call(this, dt);
},
});
exec: function() {
events.trigger(eventRelay, 'CombineVarsEvent', this.name, this.other1, this.other2, this.op);
}
});
onQuestionTimeout: function () {
events.trigger(this, 'questionTimeout');
events.trigger(this, 'scoreChange', this.questions[this.current].pointsEarned);
this.set('lineColor', '#220000');
this.nextQuestion();
},
});
next: function() {
var step = this.get('step');
if(step == 0)
this.slideLabelIn(this.get('name'), 0.75);
else if(step == 1) {
this.totalLabelUp(this.get('amount'), 'amountLink', this.get('amountT'), 0.5);
}
else if(step == 2) {
events.trigger(this, 'animationCompleted');
}
this.set('step', step + 1);
}
});
boot: function() {
this.player.teleport(this.startR, this.startC);
for(var i=0; i=0; i-=1) {
list.push(TextBox.create({}, this.introText[i], 250, 200, '/resources/green.png', ((i