C
Carcophan
Guest
Hello everyone.
My code, below, seems to be triggering two message boxes, and 'ignoring' the game_restart() code. I am still learning the finer details, but what am I doing wrong here??
I am experiencing TWO message boxes, a '1' and a '4' for example. Sees like '4' should never trigger if '1' was first triggered. Is there a speed/timing issue or something? I also don't understand how a collision can occur twice in general, let alone how the restart is skipped.
Psudo code:
My code, below, seems to be triggering two message boxes, and 'ignoring' the game_restart() code. I am still learning the finer details, but what am I doing wrong here??
I am experiencing TWO message boxes, a '1' and a '4' for example. Sees like '4' should never trigger if '1' was first triggered. Is there a speed/timing issue or something? I also don't understand how a collision can occur twice in general, let alone how the restart is skipped.
Psudo code:
Code:
x += x_speed_;
if(x_speed_ > 0) { //collision right side
if(cx = 17){
show_message("1");
game_restart(); //not triggering, before '4' is triggered
} else {
//other code
}
}
} else if x_speed_ < 0 { //collision left
if(cx = 17){
show_message("2");
game_restart();
} else {
//other code
}
}
}
y += y_speed_;
if y_speed_ > 0 {
if(cx = 17){
show_message("3");
game_restart();
} else {
//other code
}
} else {
if(cx = 17){
show_message("4");
game_restart();
} else {
//other code
}
}