I want to have a set amount of time between my explosion function and the reset function, if I don't have a set amount of time, the code quickly executes the reset function after the execution function. This makes the explosion basically invisible. I tried setting a timeOut on the reset function, but that didn't change anything.
Here is the code:
function loop(){
//game code up here
if(out){
//run explode for certain amount of time then call reset function
explode();
//setTimeout(reset, time)
reset();
}
}
setInterval(loop, 10)