Master Cabalist
Member
Hi
Can someone *please* help fix this. I've been trying to fix it for over a month down. I have a bar at the top of my screen that lets you select a bat to play as. Once you click on it, it greys out and a timer starts counting down until you can use that bat again. Simple, right? But what is happening is I click on the lightning bat it starts counting down and then I click on the wind bat and suddenly the two sync up. If the lightning bat is at say, 23, and I pull the wind bat, the wind bat syncs up to 23,
I know the first thing you would think is that they are sharing a variable but I've exhausted that option. I've tried going through the debugger and I didn't get much help wit h that either. I'm going to paste some code and hopefully get some help. There has to be something *I'm* missing.
Bats2 Object Step Event
Bats 3 Object Step Event
Drop Bat Object Step
Can someone *please* help fix this. I've been trying to fix it for over a month down. I have a bar at the top of my screen that lets you select a bat to play as. Once you click on it, it greys out and a timer starts counting down until you can use that bat again. Simple, right? But what is happening is I click on the lightning bat it starts counting down and then I click on the wind bat and suddenly the two sync up. If the lightning bat is at say, 23, and I pull the wind bat, the wind bat syncs up to 23,
I know the first thing you would think is that they are sharing a variable but I've exhausted that option. I've tried going through the debugger and I didn't get much help wit h that either. I'm going to paste some code and hopefully get some help. There has to be something *I'm* missing.
Bats2 Object Step Event
Code:
//myTimer
global.batBcountdown--;
//count down on myTimer to 0.
//at 0 you have the bat
if (global.batBcountdown <= 0)
{
Player.hasbatB = true; //have bat
Player.myTimerbatB = false; //myTimer is not active
with (global.bhourglass) //destroy the hourglasds icon
{
instance_destroy();
global.batBcountdown = room_speed*50; //restore the countdown
//global.batBmyTimer =0;
}
}
Code:
draw_self();
if (Player.hasbatC)
{
draw_sprite(WindBatFace, 0, x, y);
}
else
{
draw_sprite(GreyScaleWind, 0, x, y);
}
if (Player.myTimerbatC == true)
{
draw_set_colour(c_red);
draw_set_font(myTimerFont);
draw_text_transformed_colour(x+50, 20, string(floor(global.batCcountdown/50)), 4, 4, 0, c_black, c_black, c_black, c_black, 1.0);
draw_set_font(Arial_Font_Modified);
draw_set_colour(c_black);
}
Code:
global.sentry_myTimer--;
if (y > 800)
{
with (Player)
{
if (global.dropped_bat == false)
{
global.dracula_myTimer = 0;
if (global.select_bat == 1)
{
if (hasbatA)
{
if (global.can_click && global.sentry_myTimer <= 0) {
//global.current_bat = instance_create_depth(340, 950, 1700, SentryBatObject);
global.current_bat = instance_create_depth(340, 950, 1700, SentryBatObject);
audio_play_sound(SentryBat, 10, false);
global.dropped_bat = true;
global.sentry_myTimer = room_speed;
with (EightStarObject)
{
image_index = 1;
global.hex_myTimer = room_speed;
}
}
}
}
if (global.select_bat == 2)
{
global.current_bat = instance_create_depth(390, 1050, -1100, LightningBatObject);
with (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;
}
}
}
}
if (global.select_bat == 3)
{
global.current_bat = instance_create_depth(340, 980, 1700, WindBatObject);
with (global.current_bat)
{
audio_play_sound(DropWindBat, 10, false);
sprite_index = WindBatStill;
global.dropped_bat = true;
audio_play_sound(HurricaneBat, 10, false);
if (!global.is_anarchyMode)
{
Player.hasbatC = false;
Player.myTimerbatC = true;
global.chourglass = instance_create_depth(Bats3.x, Bats3.y, 1700, myTimerHourglassObject);
global.batCmyTimer = 0;
global.batCcountdodwn = room_speed*50;
}
else
{
Player.hasbatC = true;
Player.myTimerbatC = false;
//global.chourglass = instance_create_depth(Bats3.x, Bats3.y, -10000, myTimerHourglassObject);
//global.batCmyTimer = 0;
//global.batCcountdodwn = room_speed*50;
}
}
}