I’m still hacking away at a timer. I want the timer’s time delay to update but I can’t seem to get it to work. It stays with the initial settting.
create ()
{
let sond = this.sound.add(‘sond’);
let t = this;
this.lambda = 1;
this.next = 1;
let timedEvent = this.time.addEvent({
delay: this.next * 1000,
callback: tick,
callbackScope: this,
loop: true
});
function tick(){
t.next = -Math.log(1- Math.random() / t.lambda);
sond.play(),
}
}
update(){
this.input.on('pointermove', (pointer) => {
if(pointer.x < 400){
this.lambda = 4;
}
else if(pointer.x > 400){
this.lambda = 1;
}
});
}