I
Ike
Guest
So for this game I'm doing, I followed GravityShift Games' tutorial on making and Endless Runner but I'm expanding on it. Basically, i have an object that spawns enemies until the players gets to a certain score. Then it stops spawning enemies and spawns a jetpack that essentially triggers the player to go to the next room and continue the game in a different room. The problem is when the player does go to the next room, the enemies still won't spawn and I can't for the life of me figure out why. It's probably something simple but I can't figure it out. Here's my code in my obj_controller:
Alarm 0
randomize();
var count = irandom_range(1,2);
if room = !rm_start && !transition {
scr_obstacle();
alarm[0] = room_speed * random_range(1/global.speedModifier, 3/global.speedModifier);
}
if score >= 300 {
if score < 400 {
transition = true;
scr_jetpack();
if score < 300 {
transition = false;
}
}
}
else {
transition = false;
}
if global.gameOVer || global.transition {
exit;
}
Step Event
if !blastoff {
layer_hspeed("Background",(-global.speedModifier*6));
layer_hspeed("Transition",(-global.speedModifier*6));
layer_hspeed("Inside",(-global.speedModifier*6));
if global.gameOVer {
exit;
}
global.speedModifier += 0.0005;
if room != rm_start {
score += 1 * global.speedModifier;
}
if score >= 300 {
if score < 400 {
transition = true;
if score < 300 {
transition = false;
}
}
}
else {
transition = false
}
}
if blastoff {
layer_hspeed("Background",0);
}
Alarm 0
randomize();
var count = irandom_range(1,2);
if room = !rm_start && !transition {
scr_obstacle();
alarm[0] = room_speed * random_range(1/global.speedModifier, 3/global.speedModifier);
}
if score >= 300 {
if score < 400 {
transition = true;
scr_jetpack();
if score < 300 {
transition = false;
}
}
}
else {
transition = false;
}
if global.gameOVer || global.transition {
exit;
}
Step Event
if !blastoff {
layer_hspeed("Background",(-global.speedModifier*6));
layer_hspeed("Transition",(-global.speedModifier*6));
layer_hspeed("Inside",(-global.speedModifier*6));
if global.gameOVer {
exit;
}
global.speedModifier += 0.0005;
if room != rm_start {
score += 1 * global.speedModifier;
}
if score >= 300 {
if score < 400 {
transition = true;
if score < 300 {
transition = false;
}
}
}
else {
transition = false
}
}
if blastoff {
layer_hspeed("Background",0);
}