My value adds 0.0150 in every 90ms and when value becomes 2.15, 0.0150 is being added in every 80ms, But I want to make two of those functions, I mean that after 3.15 I want 0.0150 to be added in every 70 and etc I wrote this function but not working any solutions ?
data:{
crashValue: 1
},
mounted(){
this.startTimer();
},
methods:{
crashFunction: function() {
this.crashValue += 0.0150;
this.startTimer();
},
startTimer(){
setTimeout(this.crashFunction, this.crashValue > 2.15 ? 80 : 90);
setTimeout(this.crashFunction, this.crashValue > 3.15 ? 70 : 80); // When I add this it value goes up really really fast
}
}
<h2 class="crashNumber">{{ crashValue.toFixed(2) }}x</h2><br />