Master Cabalist
Member
Hi.
I have a bar at the top of my game where you can select a bat to use in the game to fight the enemy.
I want to, for example, use a lightning bat. So I click on the lightning bat icon and it should (in every other level does) instantiate a lightning bat. I don't know what seperates this level from the others. I ran it through the debugger and threw in some debugging statements and for all logic it should create the bat.
This is the code to create the lightning bat:
I have a bar at the top of my game where you can select a bat to use in the game to fight the enemy.
I want to, for example, use a lightning bat. So I click on the lightning bat icon and it should (in every other level does) instantiate a lightning bat. I don't know what seperates this level from the others. I ran it through the debugger and threw in some debugging statements and for all logic it should create the bat.
This is the code to create the lightning bat:
if (global.select_bat == 2)
{
show_debug_message("Creating instance of lightning bat");
global.current_bat = instance_create_depth(390, 1050, -2100, LightningBatObject);
with (global.current_bat)
{
show_debug_message("global.current_bat");
audio_play_sound(LightningStrike, 10, false);
if (Player.hasbatB)
{
show_debug_message("Player hasBatB");
sprite_index = LightningBatStill;
global.dropped_bat = true;
audio_play_sound(LightningBat, 10, false);
if (!global.is_anarchyMode)
{
Player.hasbatB = false;
Player.myTimerbatB = true;
show_debug_message("Player has myTimerBatB + " + string( Player.myTimerbatB));
show_debug_message("PLayer has hasbatB: " + string(Player.hasbatB));
global.bhourglass = instance_create_depth(Bats2.x, Bats2.y, -1100, myTimerHourglassObject);
global.batBmyTimer = 0;
global.batBcountdodwn = room_speed*50;
}
else
{
Player.hasbatB = true;
Player.myTimerbatB = false;
show_debug_message("Player has myTimerBatB + " + string( Player.myTimerbatB));
show_debug_message("PLayer has hasbatB: " + string(Player.hasbatB));
//global.bhourglass = instance_create_depth(Bats2.x, Bats2.y, -10000, myTimerHourglassObject);
//global.batBmyTimer = 0;
//global.batBcountdodwn = room_speed*50;
}
}
}
}
{
show_debug_message("Creating instance of lightning bat");
global.current_bat = instance_create_depth(390, 1050, -2100, LightningBatObject);
with (global.current_bat)
{
show_debug_message("global.current_bat");
audio_play_sound(LightningStrike, 10, false);
if (Player.hasbatB)
{
show_debug_message("Player hasBatB");
sprite_index = LightningBatStill;
global.dropped_bat = true;
audio_play_sound(LightningBat, 10, false);
if (!global.is_anarchyMode)
{
Player.hasbatB = false;
Player.myTimerbatB = true;
show_debug_message("Player has myTimerBatB + " + string( Player.myTimerbatB));
show_debug_message("PLayer has hasbatB: " + string(Player.hasbatB));
global.bhourglass = instance_create_depth(Bats2.x, Bats2.y, -1100, myTimerHourglassObject);
global.batBmyTimer = 0;
global.batBcountdodwn = room_speed*50;
}
else
{
Player.hasbatB = true;
Player.myTimerbatB = false;
show_debug_message("Player has myTimerBatB + " + string( Player.myTimerbatB));
show_debug_message("PLayer has hasbatB: " + string(Player.hasbatB));
//global.bhourglass = instance_create_depth(Bats2.x, Bats2.y, -10000, myTimerHourglassObject);
//global.batBmyTimer = 0;
//global.batBcountdodwn = room_speed*50;
}
}
}
}
Last edited: