H
happylives
Guest
Hi there,
I have a question, i'm having a 'monster' that shoots three bombs, between the shooting i want it to delay and generate a random position. I did this with a while loop and later with a recurring function. The first and second shot are random, but the third shot always has the same position as the second shot. I know this is caused by the clock used as a seed for the random generator. However i tried to created a pause in between the shooting, point being the (delay/pause) seems to be ignored. I don't know how to solve this. The feature 'delay between shooting' isn't really revolutionary. So i hope that one of you guys could help out.
Thank you in advanced and for your time!
Happylives
I have a question, i'm having a 'monster' that shoots three bombs, between the shooting i want it to delay and generate a random position. I did this with a while loop and later with a recurring function. The first and second shot are random, but the third shot always has the same position as the second shot. I know this is caused by the clock used as a seed for the random generator. However i tried to created a pause in between the shooting, point being the (delay/pause) seems to be ignored. I don't know how to solve this. The feature 'delay between shooting' isn't really revolutionary. So i hope that one of you guys could help out.
GML:
amountOfShots = argument0;
pauseTimer = argument1;
paused = argument2;
if(paused) {
if(pauseTimer <= 0){
paused = false;
pauseTimer = 300;
Shoot(amountOfShots, pauseTimer, paused)
} else {
pauseTimer -= 1;
Shoot(amountOfShots, pauseTimer, paused)
}
}
if(paused == false and amountOfShots > 0){
instance_create_layer( 500, 500, "Bombs", pointerB);
amountOfShots -= 1;
paused = true;
Shoot(amountOfShots, pauseTimer, paused)
}
Happylives