Frame 1
time_count = 0;
stop();
Frame 2
startDrag ("drag", true, 20, 20, 480, 580);
count = 1;
while (count < 10) {
duplicateMovieClip ("turtle_leader_0", "turtle_leader_" + count, count);
duplicateMovieClip ("turtle_move_forward_0", "turtle_move_forward_" + count, count + 10);
duplicateMovieClip ("turtle_follow_0", "turtle_follow_" + count, count + 20);
count++;
}
count = 0;
while (count < 11) {
turtle_start_x = random(370) + 81;
turtle_start_y = random(440) + 81;
setProperty("turtle_leader_" + count, _x , turtle_start_x + (random(101) - 50));
setProperty("turtle_leader_" + count, _y , turtle_start_y + (random(101) - 50));
setProperty("turtle_move_forward_" + count, _x , turtle_start_x);
setProperty("turtle_move_forward_" + count, _y , turtle_start_y);
setProperty(("turtle_move_forward_" + count) + "/line", _rotation , random(361));
setProperty("turtle_follow_" + count, _x , turtle_start_x);
setProperty("turtle_follow_" + count, _y , turtle_start_y);
setProperty("turtle_follow_" + count, _xscale , random(40) + 81);
setProperty("turtle_follow_" + count, _yscale , getProperty("turtle_follow_" + count, _xscale));
Set(("turtle_move_forward_" + count) + ":leader", "turtle_leader_" + count);
Set(("turtle_move_forward_" + count) + ":movement_speed", random(100) + 51);
Set(("turtle_move_forward_" + count) + ":rotation_speed", random(10) + 21);
Set(("turtle_follow_" + count) + ":count", count);
Set(("turtle_leader_" + count) + ":count", count);
count++;
}
Set("kayak_move_forward:leader", "drag");
Set("kayak_move_forward:movement_speed", 75);
Set("kayak_move_forward:rotation_speed", 15);
kayak_follow.swapDepths(100);
turtles_left_count = 10;
Frame 3
stop();
Frame 4
if (high_scores_loaded == "true") {
high_scores_compare_count = 1;
while (high_scores_compare_count < 51) {
if (time_count < eval ("score_" + high_scores_compare_count)) {
high_scores_update_count = 50;
while (high_scores_compare_count < high_scores_update_count) {
Set("score_" + high_scores_update_count, eval ("score_" + (high_scores_update_count - 1)));
Set(("score_" + high_scores_update_count) + "_name", eval (("score_" + (high_scores_update_count - 1)) + "_name"));
high_scores_update_count--;
}
high_score_set = "true";
Set("score_" + high_scores_compare_count, time_count);
Set("content:new_score_count", high_scores_compare_count);
high_scores_compare_count = 51;
}
high_scores_compare_count++;
}
if (high_score_set == "true") {
gotoAndStop (7);
} else {
gotoAndStop (1);
}
}
Frame 6
gotoAndPlay (4);
Frame 7
tellTarget ("content") {
gotoAndStop ("name_submit");
};
stop();
Symbol 8 Button
on (release) {
tellTarget ("content") {
gotoAndStop ("blank");
};
gotoAndPlay (2);
}
Symbol 9 Button
on (release) {
Set("content:content", "Loading High Scores...");
Set("content:high_scores_loaded", "false");
loadVariables ("http://www.pigdogtoad.com/turtle_herder/th_high_scores.txt?" + random(99999), "content");
tellTarget ("content") {
gotoAndPlay ("high_scores");
};
}
Symbol 10 Button
on (release) {
tellTarget ("content") {
gotoAndStop ("instructions");
};
}
Symbol 11 Button
on (release) {
tellTarget ("content") {
gotoAndStop ("about");
};
}
Symbol 16 Button
on (release) {
gotoAndStop (1);
}
Symbol 19 Button
on (press, dragOver) {
if (-80 < scrollbar_y) {
setProperty("../scrollbar", _y , scrollbar_y - 1);
}
}
Symbol 20 MovieClip Frame 1
scrollbar_y = getProperty("../scrollbar", _y);
Symbol 20 MovieClip Frame 2
scrollbar_y = getProperty("../scrollbar", _y);
Symbol 21 Button
on (press, dragOver) {
if (scrollbar_y < 60) {
setProperty("../scrollbar", _y , scrollbar_y + 1);
}
}
Symbol 22 MovieClip Frame 1
scrollbar_y = getProperty("../scrollbar", _y);
Symbol 22 MovieClip Frame 2
scrollbar_y = getProperty("../scrollbar", _y);
Symbol 24 Button
on (press, dragOver) {
startDrag ("", false, 150, -80, 150, 60);
}
on (release, releaseOutside) {
stopDrag();
}
Symbol 25 MovieClip Frame 1
..:content.scroll = Math.round(((_y + 80) / 140) * ..:content.maxscroll);
Symbol 25 MovieClip Frame 2
..:content.scroll = Math.round(((_y + 80) / 140) * ..:content.maxscroll);
Symbol 29 Button
on (release) {
if (name_submit != "") {
Set(("..:score_" + new_score_count) + "_name", name_submit);
data = "";
data_build_count = 1;
while (data_build_count < 51) {
data = (((((((data + "&score_") + data_build_count) + "=") + eval ("..:score_" + data_build_count)) + "&score_") + data_build_count) + "_name=") + eval (("..:score_" + data_build_count) + "_name");
data_build_count++;
}
data = data + "&high_scores_loaded=true";
loadVariablesNum ("http://www.pigdogtoad.com/turtle_herder/th_high_scores.pl", 0, "POST");
tellTarget ("../") {
gotoAndStop ("title");
};
name_submit = "";
gotoAndStop (1);
}
}
Symbol 31 MovieClip Frame 1
stop();
Symbol 31 MovieClip Frame 2
if (high_scores_loaded == "true") {
content = (("High Scores:\r--------------------------------------------------\r1) " + score_1) + " - ") + score_1_name;
count = 2;
while (count < 51) {
content = (((((content + newline) + count) + ") ") + eval ("score_" + count)) + " - ") + eval (("score_" + count) + "_name");
count++;
}
content = (content + newline) + "--------------------------------------------------";
gotoAndStop (7);
}
Symbol 31 MovieClip Frame 4
gotoAndPlay (2);
Symbol 31 MovieClip Frame 5
content = "Instructions:\r--------------------------------------------------\rMovement:\rUse the mouse to guide the marine biologist around the screen. His job is to direct the lost sea turtles to the beach.\r--------------------------------------------------\rGoal:\rThe game is over when all turtles are out of the water. Time is important, so hurry!\r--------------------------------------------------";
stop();
Symbol 31 MovieClip Frame 6
content = "About:\r--------------------------------------------------\rDevelopers have built condominiums on the beach where 10 sea turtles lay their eggs every year. Without their usual beach, the turtles are confused and don't know where to go. A marine biologist has been dispatched to guide the turtles to a new, undeveloped beach where they can lay their eggs.\r--------------------------------------------------\rTurtle Herder was created to be a simple distraction for people to waste their time with. The code, concept, artwork, and all other aspects of this game were developed by Cooper Faust.\r--------------------------------------------------";
gotoAndStop (7);
stop();
Symbol 31 MovieClip Frame 7
stop();
Symbol 31 MovieClip Frame 8
stop();
Symbol 34 MovieClip Frame 1
destination_x = getProperty("../" + leader, _x);
destination_y = getProperty("../" + leader, _y);
move_forward_x = _x;
move_forward_y = _y;
move_forward_rotation = getProperty("line", _rotation);
rotation_difference = (Math.atan2(destination_y - move_forward_y, destination_x - move_forward_x) / (Math.PI/180)) - move_forward_rotation;
hypotenuse = Math.sqrt(((destination_x - move_forward_x) * (destination_x - move_forward_x)) + ((destination_y - move_forward_y) * (destination_y - move_forward_y)));
if (180 < rotation_difference) {
rotation_difference = rotation_difference - 360;
} else if (rotation_difference < -180) {
rotation_difference = rotation_difference + 360;
}
if ((herded eq "true") or (beached eq "true")) {
setProperty("line", _rotation , move_forward_rotation + (rotation_difference / (rotation_speed / 2)));
setProperty("line", _xscale , hypotenuse / (movement_speed / 2));
} else {
setProperty("line", _rotation , move_forward_rotation + (rotation_difference / rotation_speed));
setProperty("line", _xscale , hypotenuse / movement_speed);
}
if ((move_forward_rotation < -90) or (90 < move_forward_rotation)) {
horizontal_modifier = -1;
} else {
horizontal_modifier = 1;
}
if (move_forward_rotation < 0) {
vertical_modifier = -1;
} else {
vertical_modifier = 1;
}
_x = (move_forward_x + (_width * horizontal_modifier));
_y = (move_forward_y + (_height * vertical_modifier));
Symbol 34 MovieClip Frame 2
gotoAndPlay (1);
Symbol 38 MovieClip Frame 1
stop();
Symbol 38 MovieClip Frame 32
gotoAndStop (1);
Symbol 38 MovieClip Frame 33
gotoAndStop (2);
Symbol 38 MovieClip Frame 34
gotoAndStop (3);
Symbol 38 MovieClip Frame 35
gotoAndStop (4);
Symbol 38 MovieClip Frame 36
gotoAndStop (5);
Symbol 38 MovieClip Frame 37
gotoAndStop (6);
Symbol 38 MovieClip Frame 38
gotoAndStop (7);
Symbol 38 MovieClip Frame 39
gotoAndStop (8);
Symbol 38 MovieClip Frame 40
gotoAndStop (9);
Symbol 38 MovieClip Frame 41
gotoAndStop (10);
Symbol 38 MovieClip Frame 42
gotoAndStop (11);
Symbol 38 MovieClip Frame 43
gotoAndStop (12);
Symbol 38 MovieClip Frame 44
gotoAndStop (13);
Symbol 38 MovieClip Frame 45
gotoAndStop (14);
Symbol 38 MovieClip Frame 46
gotoAndStop (15);
Symbol 39 MovieClip Frame 1
_rotation = getProperty(("../turtle_move_forward_" + count) + "/line", _rotation);
_x = getProperty("../turtle_move_forward_" + count, _x);
_y = getProperty("../turtle_move_forward_" + count, _y);
speed = Math.round(eval (("../turtle_move_forward_" + count) + ":hypotenuse") / 40);
gotoAndStop("turtle:" + (getProperty("turtle", _currentframe) + speed));
if (this.hitTest("../beach_zone")) {
Set(("../turtle_leader_" + count) + ":beached", "true");
Set(("../turtle_leader_" + count) + ":speed_count", ("../turtle_leader_" + count) + ":speed");
Set(("../turtle_move_forward_" + count) + ":beached", "true");
} else if (this.hitTest("../herd_zone")) {
Set(("../turtle_leader_" + count) + ":herded", "true");
Set(("../turtle_leader_" + count) + ":speed_count", ("../turtle_leader_" + count) + ":speed");
Set(("../turtle_move_forward_" + count) + ":herded", "true");
} else {
Set(("../turtle_leader_" + count) + ":herded", "false");
Set(("../turtle_move_forward_" + count) + ":herded", "false");
Set(("../turtle_leader_" + count) + ":beached", "false");
Set(("../turtle_move_forward_" + count) + ":beached", "false");
}
Symbol 39 MovieClip Frame 2
gotoAndPlay (1);
Symbol 40 MovieClip Frame 1
turtle_follow_x = getProperty("../turtle_follow_" + count, _x);
turtle_follow_y = getProperty("../turtle_follow_" + count, _y);
if (620 < turtle_follow_x) {
gotoAndStop (4);
}
if (beached eq "true") {
destination_x = 650;
destination_y = turtle_follow_y;
speed = random(50) + 26;
} else if (herded eq "true") {
destination_x = turtle_follow_x + ((turtle_follow_x - getProperty("../herd_zone", _x)) * (random(2) + 3));
destination_y = turtle_follow_y + ((turtle_follow_y - getProperty("../herd_zone", _y)) * (random(2) + 3));
speed = random(25) + 26;
} else {
destination_x = _x + (random(201) - 100);
destination_y = _y + (random(201) - 100);
speed = random(75) + 51;
}
if (destination_x < 80) {
destination_x = 80;
} else if (((450 < destination_x) and (herded eq "false")) and (beached eq "false")) {
destination_x = 450;
}
if (destination_y < 80) {
destination_y = 80;
} else if (520 < destination_y) {
destination_y = 520;
}
_x = destination_x;
_y = destination_y;
speed = random(50) + 51;
speed_count = 0;
Symbol 40 MovieClip Frame 2
if (speed_count < speed) {
speed_count = speed_count + 1;
} else {
gotoAndPlay (1);
}
Symbol 40 MovieClip Frame 3
gotoAndPlay (2);
Symbol 40 MovieClip Frame 4
Set("..:turtles_left_count", ..:turtles_left_count - 1);
if (..:turtles_left_count == 0) {
removeMovieClip("../kayak_follow");
Set("..:high_score_set", "false");
Set("..:high_scores_loaded", "false");
loadVariablesNum ("http://www.pigdogtoad.com/turtle_herder/th_high_scores.txt?" + random(99999), 0);
tellTarget ("../") {
gotoAndPlay ("check_high_scores");
};
}
removeMovieClip("../turtle_move_forward_" + count);
removeMovieClip("../turtle_follow_" + count);
removeMovieClip("");
stop();
Symbol 63 MovieClip Frame 1
stop();
Symbol 63 MovieClip Frame 69
gotoAndStop (1);
Symbol 63 MovieClip Frame 70
gotoAndStop (2);
Symbol 63 MovieClip Frame 71
gotoAndStop (3);
Symbol 63 MovieClip Frame 72
gotoAndStop (4);
Symbol 63 MovieClip Frame 73
gotoAndStop (5);
Symbol 63 MovieClip Frame 74
gotoAndStop (6);
Symbol 63 MovieClip Frame 75
gotoAndStop (7);
Symbol 64 MovieClip Frame 1
_rotation = getProperty("../kayak_move_forward/line", _rotation);
_x = getProperty("../kayak_move_forward", _x);
_y = getProperty("../kayak_move_forward", _y);
setProperty("../kayak_shadow", _rotation , _rotation);
setProperty("../kayak_shadow", _x , _x - 2);
setProperty("../kayak_shadow", _y , _y + 3);
setProperty("../herd_zone", _rotation , _rotation);
setProperty("../herd_zone", _x , _x);
setProperty("../herd_zone", _y , _y);
speed = Math.round(../kayak_move_forward:hypotenuse / 100);
gotoAndStop("kayak:" + (getProperty("kayak", _currentframe) + speed));
Symbol 64 MovieClip Frame 2
gotoAndPlay (1);
Symbol 69 MovieClip Frame 1
if (0 < ..:turtles_left_count) {
Set("..:time_count", ..:time_count + 1);
} else {
gotoAndStop (3);
}
Symbol 69 MovieClip Frame 2
gotoAndPlay (1);
Symbol 69 MovieClip Frame 3
stop();