| 1 |
if (live_call()) |
| 2 |
return global.live_result; |
| 3 |
var speed_modifier = 1 + ((1 - (seesaw_item_number / seesaw_item_number_max)) * 1.5); |
| 4 |
if (seesaw_puzzle_activate == true) |
| 5 |
{ |
| 6 |
seesaw_puzzle_activate = false; |
| 7 |
alarm[1] = 30;gml_Object_obj_factory_02_seesaw_puzzle_Alarm_1.gmlseesaw_puzzle_countdown -= 1;
if (seesaw_puzzle_countdown > 0)
{
audio_play_sound(snd_beep, 1, 0);
alarm[1] = 30;
}
else
{
audio_play_sound(snd_puzzle_start, 1, 0);
seesaw_item_number = seesaw_item_number_max;
seesaw_item_number_wrong = 3;
seesaw_puzzle_active = true;
exit;
}
with (obj_steamworks_factory_02_face)
{
sprite_index = spr_steamworks_38_face_numbers;
image_index = other.seesaw_puzzle_countdown - 1;
image_speed = 0;
} |
| 8 |
} |
| 9 |
if (seesaw_puzzle_active == true) |
| 10 |
{ |
| 11 |
if (seesaw_item_offset > 0) |
| 12 |
{ |
| 13 |
seesaw_item_offset--; |
| 14 |
} |
| 15 |
else |
| 16 |
{ |
| 17 |
seesaw_item_offset = seesaw_item_offset_max / speed_modifier; |
| 18 |
seesaw_spawn_item = true; |
| 19 |
} |
| 20 |
if (global.left_key) |
| 21 |
{ |
| 22 |
if (obj_seesaw.phy_rotation > -seesaw_angle_max) |
| 23 |
obj_seesaw.phy_rotation -= 1; |
| 24 |
} |
| 25 |
if (global.right_key) |
| 26 |
{ |
| 27 |
if (obj_seesaw.phy_rotation < seesaw_angle_max) |
| 28 |
obj_seesaw.phy_rotation += 1; |
| 29 |
} |
| 30 |
obj_seesaw_light.image_angle = -obj_seesaw.phy_rotation; |
| 31 |
with (obj_steamworks_factory_02_face) |
| 32 |
{ |
| 33 |
sprite_index = spr_steamworks_38_face_numbers; |
| 34 |
image_index = other.seesaw_item_number - 1; |
| 35 |
image_speed = 0; |
| 36 |
} |
| 37 |
if (hint_button_alpha < 1) |
| 38 |
hint_button_alpha += 0.1; |
| 39 |
} |
| 40 |
else if (hint_button_alpha > 0) |
| 41 |
{ |
| 42 |
hint_button_alpha -= 0.2; |
| 43 |
} |
| 44 |
if (seesaw_spawn_item && !instance_exists(obj_factory_02_seesaw_item_ready)) |
| 45 |
{ |
| 46 |
audio_play_sound(snd_factory_puzzle_spawn_item, 1, 0); |
| 47 |
instance_create_depth(360, 90, -1000, obj_factory_02_seesaw_item_ready); |
| 48 |
seesaw_spawn_item = false; |
| 49 |
} |
| 50 |
var strikes = 3 - seesaw_item_number_wrong; |
| 51 |
with (obj_factory_02_conveyor_indicator) |
| 52 |
{ |
| 53 |
if (strikes >= indicator_flag && sprite_index != spr_conveyor_indicator_red_x) |
| 54 |
sprite_index = spr_conveyor_indicator_red_x; |
| 55 |
} |
| 56 |
if (strikes == 3) |
| 57 |
{ |
| 58 |
if (!alarm[0]) |
| 59 |
alarm[0] = 30; |
| 60 |
seesaw_puzzle_active = false; |
| 61 |
with (obj_conveyor_belt) |
| 62 |
{ |
| 63 |
image_index = 0; |
| 64 |
image_speed = 0; |
| 65 |
} |
| 66 |
with (obj_factory_02_conveyor_item) |
| 67 |
destroy_self = true; |
| 68 |
} |
| 69 |
if (seesaw_item_number <= 0 || seesaw_item_number_wrong <= 0) |
| 70 |
{ |
| 71 |
instance_destroy(); |
| 72 |
with (obj_steamworks_factory_02_face) |
| 73 |
{ |
| 74 |
sprite_index = spr_steamworks_38_face_hello; |
| 75 |
image_index = 0; |
| 76 |
image_speed = 1; |
| 77 |
} |
| 78 |
with (obj_factory_02_seesaw_item_ready) |
| 79 |
destroy_self = true; |
| 80 |
with (obj_factory_02_seesaw_item) |
| 81 |
destroy_self = true; |
| 82 |
} |