Frame 1
fscommand ("allowscale", false);
Stage.showMenu = false;
Frame 2
loadedbytes = getBytesLoaded();
totalbytes = getBytesTotal();
if (loadedbytes == totalbytes) {
gotoAndStop (5);
}
frame = int(loadedbytes / (totalbytes / 100));
loader.gotoAndStop(_root.frame);
Frame 3
gotoAndPlay (1);
Frame 5
stop();
Instance of Symbol 61 MovieClip in Frame 5
on (release) {
getURL ("http://www.newgrounds.com/collection/thanksgiving2007", "_blank");
}
Frame 6
stop();
Frame 7
stop();
Frame 8
_root.credit_panel._visible = false;
_root.instruction_panel._visible = false;
stop();
onEnterFrame(onLoad);
opening_music = new Sound();
opening_music.attachSound("opening_music");
game_music = new Sound();
game_music.attachSound("game_music");
music_running = new Sound();
music_running.attachSound("music_running");
opening_music.start(0, 999);
Instance of Symbol 109 MovieClip "credit_panel" in Frame 8
on (release) {
_root.credit_panel._visible = false;
}
Instance of Symbol 123 MovieClip "instruction_panel" in Frame 8
on (release) {
_root.instruction_panel._visible = false;
}
Frame 9
function cavemanHitMC(mc) {
var _local1 = Math.min(myCaveman_mc._width, myCaveman_mc._height);
var _local3 = myCaveman_mc._x - _local1;
var _local6 = myCaveman_mc._x + _local1;
var _local5 = myCaveman_mc._y - _local1;
var _local4 = myCaveman_mc._y + _local1;
return(((mc.hitTest(myCaveman_mc._x, _local5, true) || (mc.hitTest(myCaveman_mc._x, _local4, true))) || (mc.hitTest(_local3, myCaveman_mc._y, true))) || (mc.hitTest(_local6, myCaveman_mc._y, true)));
}
function removeTurkey(indexIn) {
if (((mapTurkey[caveman_in_map_y][caveman_in_map_x] > 0) && (indexIn < mapTurkey[caveman_in_map_y][caveman_in_map_x])) && (indexIn >= 0)) {
if (indexIn != (mapTurkey[caveman_in_map_y][caveman_in_map_x] - 1)) {
_root["myTurkey" + indexIn].removeMovieClip();
_root["myTurkey" + (mapTurkey[caveman_in_map_y][caveman_in_map_x] - 1)].duplicateMovieClip("myTurkey" + indexIn, indexIn);
_root["myTurkey" + indexIn]._x = _root["myTurkey" + (mapTurkey[caveman_in_map_y][caveman_in_map_x] - 1)]._x;
_root["myTurkey" + indexIn]._y = _root["myTurkey" + (mapTurkey[caveman_in_map_y][caveman_in_map_x] - 1)]._y;
_root["myTurkey" + indexIn].turkeyIndex = indexIn;
_root["myTurkey" + indexIn].areaNumber = _root["myTurkey" + (mapTurkey[caveman_in_map_y][caveman_in_map_x] - 1)].areaNumber;
}
_root["myTurkey" + (mapTurkey[caveman_in_map_y][caveman_in_map_x] - 1)].removeMovieClip();
turkeyCount--;
mapTurkey[caveman_in_map_y][caveman_in_map_x]--;
updateTurkeyCountTextField();
}
}
function animalHitBlock(animal) {
return(((myBlock_mc.hitTest(animal._x - animal._width, animal._y - animal._height, true) || (myBlock_mc.hitTest(animal._x - animal._width, animal._y + animal._height, true))) || (myBlock_mc.hitTest(animal._x + animal._width, animal._y - animal._height, true))) || (myBlock_mc.hitTest(animal._x + animal._width, animal._y + animal._height, true)));
}
function getCurrentStatus() {
var _local1 = ("Stage: " + nextStage) + ", ";
_local1 = _local1 + ((turkeyCount + ((turkeyCount > 1) ? " Turkeys" : " Turkey")) + " left.");
return(_local1);
}
function createTurkey() {
if (turkeyCount == 0) {
NO_OF_TURKEY = 2 * ((nextStage * 2) + 1);
turkeyCount = NO_OF_TURKEY;
var _local3 = NO_OF_TURKEY;
while (_local3 != 0) {
var _local2 = random(map[0].length);
var _local1 = random(map.length);
if (map[_local1][_local2] != "0000") {
mapTurkey[_local1][_local2]++;
_local3--;
}
}
}
createNewTurkey(mapTurkey[caveman_in_map_y][caveman_in_map_x]);
}
function createNewTurkey(inNumber) {
if (nextStage <= NO_OF_STAGE) {
i = 0;
while (i < inNumber) {
turkey_mc.duplicateMovieClip("myTurkey" + i, i);
_root["myTurkey" + i].turkeyIndex = i;
do {
var notOkay = false;
_root["myTurkey" + i]._x = Math.floor(_root["myTurkey" + i]._width / 2) + Math.floor(Math.random() * ((WIDTH - _root["myTurkey" + i]._width) + 1));
_root["myTurkey" + i]._y = Math.floor(_root["myTurkey" + i]._height / 2) + Math.floor(Math.random() * ((HEIGHT - _root["myTurkey" + i]._height) + 1));
if (animalHitBlock(_root["myTurkey" + i]) || (_root["myTurkey" + i].hitTest(myCaveman_mc))) {
notOkay = true;
} else {
var _local2 = 0;
while (_local2 < i) {
if (_root["myTurkey" + i].hitTest(_root["myTurkey" + _local2])) {
notOkay = true;
break;
}
_local2++;
}
}
} while (notOkay);
_root["myTurkey" + i].areaNumber = Math.floor(_root["myTurkey" + i]._x / (WIDTH / COLUMN)) + (COLUMN * Math.floor(_root["myTurkey" + i]._y / (HEIGHT / ROW)));
i++;
}
}
updateTurkeyCountTextField();
}
function createWildPig() {
if (nextStage <= NO_OF_STAGE) {
var _local2 = 0;
while (_local2 < NO_OF_WILD_PIG) {
wildPig_mc.duplicateMovieClip("myWildPig" + _local2, NO_OF_TURKEY + wildPigCount);
_root["myWildPig" + _local2].wildPigIndex = _local2;
do {
var notOkay = false;
_root["myWildPig" + _local2]._x = Math.floor(_root["myWildPig" + _local2]._width / 2) + Math.floor(Math.random() * ((WIDTH - _root["myWildPig" + _local2]._width) + 1));
_root["myWildPig" + _local2]._y = Math.floor(_root["myWildPig" + _local2]._height / 2) + Math.floor(Math.random() * ((HEIGHT - _root["myWildPig" + _local2]._height) + 1));
var _local4 = Math.pow(_root["myWildPig" + _local2]._x - _root.myCaveman_mc._x, 2) + Math.pow(_root["myWildPig" + _local2]._y - _root.myCaveman_mc._y, 2);
if (((animalHitBlock(_root["myWildPig" + _local2]) || (_root["myWildPig" + _local2].hitTest(myCaveman_mc))) || (wildPigHitTurkey(_root["myWildPig" + _local2]))) || (_local4 < 20000)) {
notOkay = true;
} else {
var _local3 = 0;
while (_local3 < _local2) {
if (_root["myWildPig" + _local2].hitTest(_root["myWildPig" + _local3])) {
notOkay = true;
break;
}
_local3++;
}
}
} while (notOkay);
_root["myWildPig" + _local2].areaNumber = Math.floor(_root["myWildPig" + wildPigCount]._x / (WIDTH / COLUMN)) + (COLUMN * Math.floor(_root["myWildPig" + wildPigCount]._y / (HEIGHT / ROW)));
wildPigCount++;
_local2++;
}
}
}
function updateTurkeyCountTextField() {
turkeyCount_txt.text = "" + turkeyCount;
var textFormat = new TextFormat();
with (textFormat) {
font = "Arial Black";
color = 16777215 /* 0xFFFFFF */;
bold = true;
size = 24;
}
turkeyCount_txt.setTextFormat(textFormat);
}
function outOfBound(animal) {
if ((animal._x < (animal._width / 2)) || (animal._x > (_root.WIDTH - (animal._width / 2)))) {
return(true);
}
if ((animal._y < (animal._height / 2)) || (animal._y > (_root.HEIGHT - (animal._height / 2)))) {
return(true);
}
return(false);
}
function wildPigHitTurkey(wildPigIn) {
var _local2 = 0;
while (_local2 < mapTurkey[caveman_in_map_y][caveman_in_map_x]) {
if (wildPigIn.hitTest(_root["myTurkey" + _local2])) {
return(true);
}
_local2++;
}
return(false);
}
function turkeyHitWildPig(turkeyIn) {
var _local2 = 0;
while (_local2 < wildPigCount) {
if (turkeyIn.hitTest(_root["myWildPig" + _local2].wildPigHitTest_mc)) {
return(true);
}
_local2++;
}
return(false);
}
function createAnimal() {
createTurkey();
NO_OF_WILD_PIG = nextStage + 1;
createWildPig();
}
function createCaveman() {
myCaveman.duplicateMovieClip("myCaveman_mc", 5000);
do {
myCaveman_mc._x = Math.floor(myCaveman_mc._width / 2) + Math.floor(Math.random() * ((WIDTH - myCaveman_mc._width) + 1));
myCaveman_mc._y = Math.floor(myCaveman_mc._height / 2) + Math.floor(Math.random() * ((HEIGHT - myCaveman_mc._height) + 1));
} while (cavemanHitMC(myBlock_mc));
myCaveman_mc._xscale = 50;
myCaveman_mc._yscale = 50;
myCaveman_mc.areaNumber = Math.floor(myCaveman_mc._x / (WIDTH / COLUMN)) + (COLUMN * Math.floor(myCaveman_mc._y / (HEIGHT / ROW)));
}
function hitTurkeyInCurrentArea(mc) {
var _local3 = 0;
while (_local3 < _root.mapTurkey[caveman_in_map_y][caveman_in_map_x]) {
if (_root["myTurkey" + _local3].areaNumber == mc.areaNumber) {
if (this.hitTest(_root["myTurkey" + _local3])) {
return(true);
}
}
_local3++;
}
return(false);
}
function attackTurkey() {
var _local2 = 0;
while (_local2 < _root.mapTurkey[caveman_in_map_y][caveman_in_map_x]) {
if (_root.myCaveman_mc.hitTurkey_mc.hitTest(_root["myTurkey" + _local2])) {
_root.removeTurkey(_local2);
break;
}
_local2++;
}
}
function createBlock() {
attachMovie(load_map, "myBlock_mc", 9000);
myBlock_mc._x = WIDTH / 2;
myBlock_mc._y = HEIGHT / 2;
}
function determineEscapeDirection(i) {
var _local2;
var _local3 = Math.atan2(myCaveman_mc._y - _root["myTurkey" + i]._y, myCaveman_mc._x - _root["myTurkey" + i]._x);
if (_local3 < -1.5707963267949) {
_local2 = 0;
} else if (_local3 < 0) {
_local2 = 2;
} else if (_local3 < (Math.PI/2)) {
_local2 = 4;
} else {
_local2 = 6;
}
return(_local2 + random(3));
}
function turkeyHitTurkeyInCurrentArea(turkeyIn) {
var _local2 = 0;
while (_local2 < _root.mapTurkey[caveman_in_map_y][caveman_in_map_x]) {
if ((_local2 != turkeyIn.turkeyIndex) && (_root["myTurkey" + _local2].areaNumber == turkeyIn.areaNumber)) {
if (turkeyIn.hitTest(_root["myTurkey" + _local2])) {
return(true);
}
}
_local2++;
}
return(false);
}
function removeAllWildPig() {
var _local2 = 0;
while (_local2 < wildPigCount) {
_root["myWildPig" + _local2].removeMovieClip();
_local2++;
}
wildPigCount = 0;
}
function removeAllTurkey() {
var _local2 = 0;
while (_local2 < mapTurkey[caveman_in_map_y][caveman_in_map_x]) {
_root["myTurkey" + _local2].removeMovieClip();
_local2++;
}
}
function initialHitTest() {
_root.attachMovie("hit_test_obj", "hit_test_up", 7500);
setProperty(_root.hit_test_up, _width , WIDTH / 2);
setProperty(_root.hit_test_down, _height , 10);
setProperty(_root.hit_test_up, _x , WIDTH / 2);
setProperty(_root.hit_test_up, _y , _root.hit_test_up._height / 2);
_root.attachMovie("hit_test_obj", "hit_test_right", 7501);
setProperty(_root.hit_test_right, _height , 250);
setProperty(_root.hit_test_right, _width , 10);
setProperty(_root.hit_test_right, _x , WIDTH - (_root.hit_test_right._width / 2));
setProperty(_root.hit_test_right, _y , 300);
_root.attachMovie("hit_test_obj", "hit_test_down", 7502);
setProperty(_root.hit_test_down, _width , WIDTH / 2);
setProperty(_root.hit_test_down, _height , 10);
setProperty(_root.hit_test_down, _x , WIDTH / 2);
setProperty(_root.hit_test_down, _y , HEIGHT - (_root.hit_test_down._height / 2));
_root.attachMovie("hit_test_obj", "hit_test_left", 7503);
setProperty(_root.hit_test_left, _width , 10);
setProperty(_root.hit_test_left, _height , 250);
setProperty(_root.hit_test_left, _x , _root.hit_test_left._width / 2);
setProperty(_root.hit_test_left, _y , 300);
}
var NO_OF_STAGE = 3;
var EXTRA_TURKEY = 5;
var nextStage = 1;
var NO_OF_TURKEY = (2 * ((nextStage * 2) + 1));
var NO_OF_WILD_PIG;
var WIDTH = 800;
var HEIGHT = 600;
var ROW = 10;
var COLUMN = 20;
var myTurkey = new Array();
var turkeyCount = 0;
var wildPigCount = 0;
var gameStartFrame = _currentframe;
var map = [["0100", "0001", "0000", "0000"], ["0000", "0000", "0000", "0000"], ["0000", "0000", "0000", "0000"], ["0000", "0000", "0000", "0000"]];
var caveman_in_map_x = 0;
var caveman_in_map_y = 0;
var load_map = map[caveman_in_map_y][caveman_in_map_x];
var mapTurkey = new Array();
var i = 0;
while (i < map.length) {
mapTurkey[i] = new Array();
var j = 0;
while (j < map[0].length) {
mapTurkey[i][j] = 0;
j++;
}
i++;
}
initialHitTest();
createTextField("turkeyCount_txt", 10000, 750, 15, 50, 55);
with (turkeyCount_txt) {
selectable = false;
_alpha = 50;
type = "dynamic";
}
opening_music.stop();
Frame 10
stop();
myCaveman._visible = false;
turkey_mc._visible = false;
wildPig_mc._visible = false;
turkeyCount_txt._visible = true;
attachMovie("turkey_profile", "turkeyProfile_mc", 20001);
turkeyProfile_mc._x = 720;
turkeyProfile_mc._y = 30;
turkeyProfile_mc._width = 52.1;
turkeyProfile_mc._height = 51.5;
turkeyProfile_mc._visible = true;
createBlock();
createCaveman();
createAnimal();
music_running.stop();
game_music = new Sound();
game_music.attachSound("game_music");
game_music.start(0, 999);
Instance of Symbol 37 MovieClip [wildPig] "wildPig_mc" in Frame 10
onClipEvent (load) {
step = 0;
speed = 4;
SENSE_PLAYER_RADIUS = 200;
tempSpeed = speed / Math.SQRT2;
}
onClipEvent (enterFrame) {
function hitWildPigInCurrentArea() {
var _local3 = 0;
while (_local3 < _root.wildPigCount) {
if ((_local3 != this.wildPigIndex) && (_root["wildPig" + _local3].areaNumber != this.areaNumber)) {
if (this.hitTest(_root["wildPig" + _local3])) {
return(true);
}
}
_local3++;
}
return(false);
}
function determineAttackDirection() {
var _local3;
var _local4 = Math.atan2(_root.myCaveman_mc._y - this._y, _root.myCaveman_mc._x - this._x);
if (_local4 < -1.5707963267949) {
_local3 = 4;
} else if (_local4 < 0) {
_local3 = 6;
} else if (_local4 < (Math.PI/2)) {
_local3 = 0;
} else {
_local3 = 2;
}
return(_local3 + Math.floor(Math.random() * 3));
}
function wildPigHitCaveman() {
return(((this == _root.wildPig_mc) ? false : (this.hitTest(_root.myCaveman_mc.wildPigHitTest_mc))));
}
distanceSquare = Math.pow(_x - _root.myCaveman_mc._x, 2) + Math.pow(_y - _root.myCaveman_mc._y, 2);
prevX = _x;
prevY = _y;
prevAreaNumber = areaNumber;
if ((this != _root.wildPig_mc) && (this.wildPigHitCaveman())) {
_root.gotoAndStop(_root.gameStartFrame + 6);
}
if (step == 0) {
if (distanceSquare < Math.pow(SENSE_PLAYER_RADIUS, 2)) {
speed = 4;
wildPigDirection = determineAttackDirection();
step = Math.floor(Math.random() * 11) + 10;
} else {
speed = 2;
step = Math.floor(Math.random() * 101) + 10;
wildPigDirection = Math.floor(Math.random() * 8);
}
tempSpeed = speed / Math.SQRT2;
}
switch (wildPigDirection % 8) {
case 0 :
_x = (_x + speed);
this._rotation = 0;
break;
case 1 :
_x = (_x + tempSpeed);
_y = (_y + tempSpeed);
this._rotation = 45;
break;
case 2 :
_y = (_y + speed);
this._rotation = 90;
break;
case 3 :
_x = (_x - tempSpeed);
_y = (_y + tempSpeed);
this._rotation = 135;
break;
case 4 :
_x = (_x - speed);
this._rotation = 180;
break;
case 5 :
_x = (_x - tempSpeed);
_y = (_y - tempSpeed);
this._rotation = -135;
break;
case 6 :
_y = (_y - speed);
this._rotation = -90;
break;
case 7 :
_x = (_x + tempSpeed);
_y = (_y - tempSpeed);
this._rotation = -45;
}
areaNumber = Math.floor(this._x / (_root.WIDTH / _root.COLUMN)) + (_root.COLUMN * Math.floor(this._y / (_root.HEIGHT / _root.ROW)));
if (((_root.outOfBound(this) || (_root.hitTurkeyInCurrentArea(this))) || (this.hitWildPigInCurrentArea())) || (_root.animalHitBlock(this))) {
this._x = prevX;
this._y = prevY;
areaNumber = prevAreaNumber;
}
step--;
}
Instance of Symbol 135 MovieClip "turkey_mc" in Frame 10
onClipEvent (load) {
speed = 4;
tempSpeed = speed / Math.SQRT2;
SENSE_PLAYER_RADIUS = 50;
step = 0;
}
onClipEvent (enterFrame) {
distanceSquare = Math.pow(this._x - _root.myCaveman_mc._x, 2) + Math.pow(this._y - _root.myCaveman_mc._y, 2);
prevX = this._x;
prevY = this._y;
prevAreaNumber = this.areaNumber;
if (distanceSquare < Math.pow(SENSE_PLAYER_RADIUS, 2)) {
speed = 4 + Math.floor(Math.random() * 9);
tempSpeed = speed / Math.SQRT2;
step = 10;
turkeyDirection = _root.determineEscapeDirection(this.turkeyIndex);
} else if (step == 0) {
speed = 4;
tempSpeed = speed / Math.SQRT2;
step = Math.floor(Math.random() * 100) + 1;
turkeyDirection = Math.floor(Math.random() * 8);
}
switch (turkeyDirection % 8) {
case 0 :
_x = (_x + speed);
this._rotation = 0;
break;
case 1 :
_x = (_x + tempSpeed);
_y = (_y + tempSpeed);
this._rotation = 45;
break;
case 2 :
_y = (_y + speed);
this._rotation = 90;
break;
case 3 :
_x = (_x - tempSpeed);
_y = (_y + tempSpeed);
this._rotation = 135;
break;
case 4 :
_x = (_x - speed);
this._rotation = 180;
break;
case 5 :
_x = (_x - tempSpeed);
_y = (_y - tempSpeed);
this._rotation = -135;
break;
case 6 :
_y = (_y - speed);
this._rotation = -90;
break;
case 7 :
_x = (_x + tempSpeed);
_y = (_y - tempSpeed);
this._rotation = -45;
}
this.areaNumber = Math.floor(this._x / (_root.WIDTH / _root.COLUMN)) + (_root.COLUMN * Math.floor(this._y / (_root.HEIGHT / _root.ROW)));
if (((_root.outOfBound(this) || (_root.animalHitBlock(this))) || (_root.turkeyHitTurkeyInCurrentArea(this))) || (_root.turkeyHitWildPig(this))) {
step = 0;
this._x = prevX;
this._y = prevY;
this.areaNumber = prevAreaNumber;
} else {
step--;
}
}
Instance of Symbol 145 MovieClip "myCaveman" in Frame 10
onClipEvent (load) {
enableSpaceBar = true;
speed = 9;
radius = 8;
max_stage = 16;
stage = 1;
next_stage = 0;
initial = 1;
hit_direction = "";
}
onClipEvent (enterFrame) {
this.walkingCaveman_mc.stop();
if (load_new_movie == 1) {
_root.removeAllWildPig();
_root.load_map = _root.map[_root.caveman_in_map_y][_root.caveman_in_map_x];
_root.createBlock();
_root.createAnimal();
if (hit_direction == "up") {
this._y = 560;
} else if (hit_direction == "down") {
this._y = 40;
} else if (hit_direction == "left") {
this._x = 760;
} else if (hit_direction == "right") {
this._x = 40;
}
load_new_movie = 0;
}
x_dir = 0;
y_dir = 0;
if (_root.turkeyCount == 0) {
_root.nextStage++;
if (_root.nextStage > _root.NO_OF_STAGE) {
_root.gotoAndStop(_root.gameStartFrame + 2);
} else {
this.stage++;
switch (stage) {
case 1 :
_root.map = [["0100", "0001", "0000", "0000"], ["0000", "0000", "0000", "0000"], ["0000", "0000", "0000", "0000"], ["0000", "0000", "0000", "0000"]];
break;
case 2 :
_root.map = [["0110", "0001", "0000", "0000"], ["1100", "0001", "0000", "0000"], ["0000", "0000", "0000", "0000"], ["0000", "0000", "0000", "0000"]];
break;
case 3 :
_root.map = [["0110", "0111", "0011", "0000"], ["1100", "1101", "1001", "0000"], ["0000", "0000", "0000", "0000"], ["0000", "0000", "0000", "0000"]];
break;
case 4 :
_root.map = [["0100", "0010", "0000", "0000"], ["0100", "1111", "0111", "0001"], ["0100", "1101", "1111", "0001"], ["0000", "0000", "1000", "0000"]];
break;
case 5 :
_root.map = [["0010", "0000", "0000", "0010"], ["1100", "0111", "0111", "1001"], ["0000", "1110", "1101", "0001"], ["0100", "1001", "0000", "0000"]];
break;
case 6 :
_root.map = [["0110", "0101", "0011", "0000"], ["1110", "0111", "1001", "0000"], ["1100", "1111", "0011", "0000"], ["0000", "1100", "1001", "0000"]];
break;
case 7 :
_root.map = [["0100", "0111", "0101", "0011"], ["0110", "1101", "0111", "1001"], ["1100", "0101", "1101", "0001"], ["0000", "0000", "0000", "0000"]];
break;
case 8 :
_root.map = [["0100", "0111", "0111", "0011"], ["0000", "1110", "1111", "1011"], ["0100", "1111", "1101", "1001"], ["0000", "1000", "0000", "0000"]];
break;
case 9 :
_root.map = [["0010", "0110", "0011", "0000"], ["1100", "1001", "1100", "0011"], ["0110", "0011", "0110", "1001"], ["1000", "1100", "1001", "0000"]];
break;
case 10 :
_root.map = [["0010", "0000", "0010", "0000"], ["1110", "0111", "1111", "0011"], ["1100", "1111", "1011", "1010"], ["0000", "1000", "1000", "1000"]];
break;
case 11 :
_root.map = [["0100", "0101", "0101", "0011"], ["0110", "0101", "0101", "1011"], ["1100", "0001", "0000", "1010"], ["0100", "0101", "0101", "1001"]];
break;
case 12 :
_root.map = [["0010", "0000", "0000", "0010"], ["1010", "0100", "0101", "1011"], ["1110", "0101", "0101", "1011"], ["1100", "0101", "0001", "1000"]];
break;
case 13 :
_root.map = [["0100", "0111", "0111", "0001"], ["0010", "1010", "1110", "0011"], ["1010", "1010", "1010", "1000"], ["1100", "1001", "1000", "0000"]];
break;
case 14 :
_root.map = [["0110", "0011", "0110", "0011"], ["1100", "1111", "1111", "1001"], ["0110", "1111", "1111", "0011"], ["1100", "1001", "1100", "1001"]];
break;
case 15 :
_root.map = [["0010", "0000", "0110", "0001"], ["1110", "0101", "1111", "0001"], ["1010", "0100", "1111", "0001"], ["1100", "0001", "1000", "0000"]];
break;
case 16 :
_root.map = [["0110", "0111", "0111", "0011"], ["1110", "1111", "1111", "1011"], ["1110", "1111", "1111", "1011"], ["1100", "1101", "1101", "1001"]];
}
_root.caveman_in_map_x = 0;
_root.caveman_in_map_y = 0;
_root.load_map = _root.map[_root.caveman_in_map_y][_root.caveman_in_map_x];
hit_direction = "";
_root.trace(nextStage);
_root.removeAllWildPig();
_root.myBlock_mc.removeMovieClip();
_root.gotoAndStop(_root.gameStartFrame + 7);
}
}
prevX = this._x;
prevY = this._y;
prevAreaNumber = this.areaNumber;
if (this.enableSpaceBar) {
if (Key.isDown(37)) {
this._x = this._x - speed;
x_dir = 1;
this.walkingCaveman_mc.play();
}
if (Key.isDown(39)) {
this._x = this._x + speed;
x_dir = ((x_dir == 1) ? 0 : 2);
this.walkingCaveman_mc.play();
}
if (Key.isDown(38)) {
this._y = this._y - speed;
y_dir = 1;
this.walkingCaveman_mc.play();
}
if (Key.isDown(40)) {
this._y = this._y + speed;
y_dir = ((y_dir == 1) ? 0 : 2);
this.walkingCaveman_mc.play();
}
}
if (Key.isDown(32)) {
if (this.enableSpaceBar) {
this.enableSpaceBar = false;
this.gotoAndPlay(2);
}
}
if (_root.hit_test_up.hitTest(_x, _y, true) && (this != _root.myCaveman)) {
_root.removeAllTurkey();
_root.caveman_in_map_y--;
load_new_movie = 1;
hit_direction = "up";
}
if (_root.hit_test_left.hitTest(_x, _y, true) && (this != _root.myCaveman)) {
_root.removeAllTurkey();
_root.caveman_in_map_x--;
load_new_movie = 1;
hit_direction = "left";
}
if (_root.hit_test_right.hitTest(_x, _y, true) && (this != _root.myCaveman)) {
_root.removeAllTurkey();
_root.caveman_in_map_x++;
load_new_movie = 1;
hit_direction = "right";
}
if (_root.hit_test_down.hitTest(_x, _y, true) && (this != _root.myCaveman)) {
_root.removeAllTurkey();
_root.caveman_in_map_y++;
load_new_movie = 1;
hit_direction = "down";
}
this.areaNumber = Math.floor(this._x / (_root.WIDTH / _root.COLUMN)) + (_root.COLUMN * Math.floor(this._y / (_root.HEIGHT / _root.ROW)));
if ((x_dir == 0) && (y_dir == 1)) {
this._rotation = 0;
} else if ((x_dir == 0) && (y_dir == 2)) {
this._rotation = 180;
} else if ((x_dir == 1) && (y_dir == 0)) {
this._rotation = -90;
} else if ((x_dir == 1) && (y_dir == 1)) {
this._rotation = -45;
} else if ((x_dir == 1) && (y_dir == 2)) {
this._rotation = -135;
} else if ((x_dir == 2) && (y_dir == 0)) {
this._rotation = 90;
} else if ((x_dir == 2) && (y_dir == 1)) {
this._rotation = 45;
} else if ((x_dir == 2) && (y_dir == 2)) {
this._rotation = 135;
}
if (_root.hitTurkeyInCurrentArea(this)) {
this._x = prevX;
this._y = prevY;
this.areaNumber = prevAreaNumber;
} else {
while (_root.myBlock_mc.hitTest(this._x, this._y + this.radius, true)) {
this._y--;
}
while (_root.myBlock_mc.hitTest(this._x, this._y - this.radius, true)) {
this._y++;
}
while (_root.myBlock_mc.hitTest(this._x - this.radius, this._y, true)) {
this._x++;
}
while (_root.myBlock_mc.hitTest(this._x + this.radius, this._y, true)) {
this._x--;
}
}
}
Frame 11
removeAllWildPig();
turkeyCount_txt.removeTextField();
turkeyProfile_mc.removeMovieClip();
myBlock_mc.removeMovieClip();
myCaveman_mc.removeMovieClip();
game_music.stop();
Frame 12
stop();
music_running.start(0, 1);
Instance of Symbol 182 MovieClip "wildpig" in Frame 12
onClipEvent (load) {
s = 1;
}
onClipEvent (enterFrame) {
if ((s * 1.1) >= 3) {
s = 3;
} else {
s = s * 1.1;
}
_x = (_x + s);
if (this.hitTest(_root.caveman)) {
_root.gotoAndStop(_root.gameStartFrame + 5);
}
}
Instance of Symbol 162 MovieClip "caveman" in Frame 12
onClipEvent (load) {
speed = 15;
radius = 8;
rightUp = true;
leftUp = true;
keylock = "";
}
onClipEvent (keyDown) {
if (rightUp && (leftUp)) {
if (Key.isDown(37) && ((keylock == "right") || (keylock == ""))) {
leftUp = false;
keylock = "left";
} else if (Key.isDown(39) && ((keylock == "left") || (keylock == ""))) {
rightUp = false;
keylock = "right";
}
_x = (_x + speed);
}
if (this.hitTest(_root.goal)) {
_root.gotoAndStop(_root.gameStartFrame + 4);
}
}
onClipEvent (keyUp) {
if (rightUp ^ leftUp) {
if ((Key.getAscii() == 37) && (!leftUp)) {
leftUp = true;
} else if ((Key.getAscii() == 39) && (!rightUp)) {
rightUp = true;
} else {
rightUp = true;
leftUp = true;
keylock = "";
}
}
}
Frame 13
stop();
turkeyCount_txt._visible = true;
gotoAndPlay(gameStartFrame + 1);
Frame 14
stop();
Frame 15
stop();
removeAllWildPig();
removeAllTurkey();
turkeyCount_txt._visible = false;
turkeyProfile_mc._visible = false;
myBlock_mc.removeMovieClip();
myCaveman_mc.removeMovieClip();
game_music.stop();
Frame 16
myStage_txt.text = "Stage " + nextStage;
myCaveman_mc.removeMovieClip();
turkeyCount_txt._visible = false;
turkeyProfile_mc._visible = false;
stop();
game_music.stop();
Instance of Symbol 96 MovieClip in Frame 16
onClipEvent (load) {
step = 0;
jump = 0;
}
onClipEvent (enterFrame) {
if (step == 0) {
step = random(30) + 1;
dir = random(2);
} else {
step--;
if (dir == 0) {
this._x++;
_xscale = 100;
} else {
this._x--;
_xscale = -100;
}
if (jump == 1) {
this._y++;
jump = 0;
} else if (!random(3)) {
this._y--;
jump = 1;
}
}
}
Instance of Symbol 96 MovieClip in Frame 16
onClipEvent (load) {
step = 0;
jump = 0;
}
onClipEvent (enterFrame) {
if (step == 0) {
step = random(30) + 1;
dir = random(2);
} else {
step--;
if (dir == 0) {
this._x++;
_xscale = 100;
} else {
this._x--;
_xscale = -100;
}
if (jump == 1) {
this._y++;
jump = 0;
} else if (!random(3)) {
this._y--;
jump = 1;
}
}
}
Instance of Symbol 96 MovieClip in Frame 16
onClipEvent (load) {
step = 0;
jump = 0;
}
onClipEvent (enterFrame) {
if (step == 0) {
step = random(30) + 1;
dir = random(2);
} else {
step--;
if (dir == 0) {
this._x++;
_xscale = 100;
} else {
this._x--;
_xscale = -100;
}
if (jump == 1) {
this._y++;
jump = 0;
} else if (!random(3)) {
this._y--;
jump = 1;
}
}
}
Instance of Symbol 96 MovieClip in Frame 16
onClipEvent (load) {
step = 0;
jump = 0;
}
onClipEvent (enterFrame) {
if (step == 0) {
step = random(30) + 1;
dir = random(2);
} else {
step--;
if (dir == 0) {
this._x++;
_xscale = 100;
} else {
this._x--;
_xscale = -100;
}
if (jump == 1) {
this._y++;
jump = 0;
} else if (!random(3)) {
this._y--;
jump = 1;
}
}
}
Instance of Symbol 96 MovieClip in Frame 16
onClipEvent (load) {
step = 0;
jump = 0;
}
onClipEvent (enterFrame) {
if (step == 0) {
step = random(30) + 1;
dir = random(2);
} else {
step--;
if (dir == 0) {
this._x++;
_xscale = 100;
} else {
this._x--;
_xscale = -100;
}
if (jump == 1) {
this._y++;
jump = 0;
} else if (!random(3)) {
this._y--;
jump = 1;
}
}
}
Instance of Symbol 96 MovieClip in Frame 16
onClipEvent (load) {
step = 0;
jump = 0;
}
onClipEvent (enterFrame) {
if (step == 0) {
step = random(30) + 1;
dir = random(2);
} else {
step--;
if (dir == 0) {
this._x++;
_xscale = 100;
} else {
this._x--;
_xscale = -100;
}
if (jump == 1) {
this._y++;
jump = 0;
} else if (!random(3)) {
this._y--;
jump = 1;
}
}
}
Symbol 51 Button
on (release) {
getURL ("http://www.armorgames.com", "blank");
}
Symbol 58 MovieClip Frame 81
_root.play();
_root.play();
Symbol 70 MovieClip Frame 40
_root.play();
Symbol 73 Button
on (release) {
gotoAndStop(_root._currentframe + 2);
}
Symbol 89 MovieClip Frame 80
_root.play();
Symbol 90 Button
on (release) {
gotoAndStop(_root._currentframe + 1);
}
Instance of Symbol 96 MovieClip in Symbol 99 MovieClip Frame 1
onClipEvent (load) {
step = 0;
jump = 0;
}
onClipEvent (enterFrame) {
if (step == 0) {
step = random(30) + 1;
dir = random(2);
} else {
step--;
if (dir == 0) {
this._x++;
_xscale = 100;
} else {
this._x--;
_xscale = -100;
}
if (jump == 1) {
this._y++;
jump = 0;
} else if (!random(3)) {
this._y--;
jump = 1;
}
}
}
Instance of Symbol 96 MovieClip in Symbol 99 MovieClip Frame 1
onClipEvent (load) {
step = 0;
jump = 0;
}
onClipEvent (enterFrame) {
if (step == 0) {
step = random(30) + 1;
dir = random(2);
} else {
step--;
if (dir == 0) {
this._x++;
_xscale = 100;
} else {
this._x--;
_xscale = -100;
}
if (jump == 1) {
this._y++;
jump = 0;
} else if (!random(3)) {
this._y--;
jump = 1;
}
}
}
Instance of Symbol 96 MovieClip in Symbol 99 MovieClip Frame 1
onClipEvent (load) {
step = 0;
jump = 0;
}
onClipEvent (enterFrame) {
if (step == 0) {
step = random(30) + 1;
dir = random(2);
} else {
step--;
if (dir == 0) {
this._x++;
_xscale = 100;
} else {
this._x--;
_xscale = -100;
}
if (jump == 1) {
this._y++;
jump = 0;
} else if (!random(3)) {
this._y--;
jump = 1;
}
}
}
Instance of Symbol 96 MovieClip in Symbol 99 MovieClip Frame 1
onClipEvent (load) {
step = 0;
jump = 0;
}
onClipEvent (enterFrame) {
if (step == 0) {
step = random(30) + 1;
dir = random(2);
} else {
step--;
if (dir == 0) {
this._x++;
_xscale = 100;
} else {
this._x--;
_xscale = -100;
}
if (jump == 1) {
this._y++;
jump = 0;
} else if (!random(3)) {
this._y--;
jump = 1;
}
}
}
Instance of Symbol 96 MovieClip in Symbol 99 MovieClip Frame 1
onClipEvent (load) {
step = 0;
jump = 0;
}
onClipEvent (enterFrame) {
if (step == 0) {
step = random(30) + 1;
dir = random(2);
} else {
step--;
if (dir == 0) {
this._x++;
_xscale = 100;
} else {
this._x--;
_xscale = -100;
}
if (jump == 1) {
this._y++;
jump = 0;
} else if (!random(3)) {
this._y--;
jump = 1;
}
}
}
Symbol 126 Button
on (release) {
gotoAndPlay(_root._currentframe + 1);
}
Symbol 128 Button
on (release) {
if (!_root.instruction_panel._visible) {
_root.instruction_panel._x = 390;
_root.instruction_panel._y = 282;
_root.credit_panel._visible = false;
_root.instruction_panel._visible = true;
} else {
_root.instruction_panel._visible = false;
}
}
Symbol 130 Button
on (release) {
if (!_root.credit_panel._visible) {
_root.credit_panel._x = 749;
_root.credit_panel._y = 382;
_root.instruction_panel._visible = false;
_root.credit_panel._visible = true;
} else {
_root.credit_panel._visible = false;
}
}
Symbol 132 Button
on (release) {
getURL ("http://www.armorgames.com/", "_blank");
}
Symbol 145 MovieClip Frame 1
enableSpaceBar = true;
stop();
Symbol 145 MovieClip Frame 5
_root.attackTurkey();
Symbol 146 Button
on (release) {
_root.gotoAndStop(_root.gameStartFrame - 1);
}
Symbol 160 Button
on (release) {
_root.gotoAndStop(_root.gameStartFrame - 1);
}
Symbol 163 MovieClip Frame 90
stop();
Symbol 179 MovieClip Frame 12
gotoAndPlay (1);
Symbol 196 MovieClip Frame 48
stop();
Symbol 205 MovieClip Frame 62
_root.gotoAndStop(_root.gameStartFrame + 3);
Symbol 207 Button
on (release) {
gotoAndStop(gameStartFrame + 1);
}