Combined Code
movieClip 3 flitspaal {
frame 1 {
stop();
}
frame 10 {
stop();
}
}
movieClip 7 {
}
movieClip 8 leeuwstand {
frame 1 {
stop();
}
frame 21 {
stop();
}
}
movieClip 11 safaribos2 {
}
movieClip 14 safaribos1 {
}
movieClip 49 zebra3 {
}
movieClip 53 skyline {
frame 1 {
function getpos() {
force = 0;
force += _parent.force;
force = _parent.speed * force * 0.2;
x -= force * forceFactor;
this._x = x;
this._y = y;
}
}
frame 1 {
x = _parent.awayX;
y = _parent.awayY;
forceFactor = 0.01;
}
frame 2 {
getpos();
}
frame 3 {
gotoAndPlay(_currentframe - 1);
}
frame 4 {
getpos();
}
frame 5 {
gotoAndPlay(_currentframe - 1);
}
frame 6 {
getpos();
}
frame 7 {
gotoAndPlay(_currentframe - 1);
}
}
movieClip 54 levelmessage {
frame 1 {
this._x = 200;
this._y = 50;
rotationSpeed = 3;
scaleSpeed = 10;
delay = 30;
this.attachMovie(graphic, 'graphic', 1000300);
}
frame 2 {
--delay;
if (delay < 0) {
this._rotation += rotationSpeed;
this._xscale -= scaleSpeed;
this._yscale -= scaleSpeed;
if (this._xscale <= scaleSpeed) {
this.removeMovieClip();
}
}
}
frame 3 {
gotoAndPlay(_currentframe - 1);
}
}
movieClip 63 {
}
movieClip 71 {
}
movieClip 73 {
}
movieClip 77 {
}
movieClip 81 {
}
movieClip 91 {
}
movieClip 92 {
}
movieClip 97 {
}
movieClip 103 {
}
movieClip 108 {
}
movieClip 109 {
frame 50 {
_parent.gotoAndPlay('gameover');
stop();
}
}
movieClip 114 {
}
movieClip 119 {
}
movieClip 120 {
frame 45 {
_parent.gotoAndPlay('gameover');
stop();
}
}
movieClip 124 {
}
movieClip 129 {
}
movieClip 132 {
}
movieClip 134 {
}
movieClip 137 {
}
movieClip 138 {
}
movieClip 139 {
}
movieClip 145 {
}
movieClip 148 {
}
movieClip 151 {
}
movieClip 152 {
frame 100 {
_parent.goKillGame();
stop();
}
}
movieClip 153 leeuw_total {
frame 1 {
function goKillGame() {
_parent.goKillGame();
}
}
frame 1 {
stop();
}
frame 2 {
stop();
}
frame 3 {
stop();
}
frame 4 {
stop();
}
frame 5 {
stop();
}
frame 6 {
stop();
}
frame 7 {
stop();
}
frame 8 {
stop();
}
frame 9 {
stop();
}
frame 10 {
stop();
}
frame 11 {
stop();
}
frame 12 {
stop();
}
frame 13 {
stop();
}
frame 14 {
stop();
}
frame 15 {
stop();
}
frame 16 {
stop();
}
frame 17 {
stop();
}
frame 18 {
stop();
}
frame 19 {
stop();
}
frame 20 {
stop();
}
frame 21 {
stop();
}
frame 22 {
stop();
}
frame 23 {
stop();
}
frame 24 {
stop();
}
frame 25 {
_parent.begin = 'omkijkend';
}
frame 78 {
_parent.go();
}
frame 144 {
trace('test1');
_parent.goKillGame();
stop();
}
frame 145 {
stop();
}
}
movieClip 154 leeuw {
frame 1 {
function die() {
this.removeMovieClip();
}
function goKillGame() {
_parent.goKillGame();
}
function knalTegenObject(whichObject) {
if (state != 'fall') {
leeuwValt();
if (_parent.soundReady()) {
_root.sound_mc.boing_snd.start(0, 1);
}
state = 'fall';
leeuw_total.gotoAndPlay('fall mid');
}
}
function leeuwValt() {
var v1 = _parent;
var v2 = _root;
if (v1.soundReady()) {
v2.sound_mc.drive1_snd.stop();
}
if (v1.soundReady()) {
v2.sound_mc.drive2_snd.stop();
}
if (v1.soundReady()) {
v2.sound_mc.drive3_snd.stop();
}
if (v1.soundReady()) {
v2.sound_mc.drive3_snd.stop();
}
if (v1.soundReady()) {
v2.sound_mc.muziekje_snd.stop();
}
if (v1.soundReady()) {
v2.sound_mc.valt_snd.start(0, 1);
}
v1.getRoadRoute();
v1.speed = 0;
v1.targetSpeed = 0;
}
function go() {
begin = false;
_parent.targetSpeed = _parent.level1Speed;
}
}
frame 1 {
this._x = _parent.homeX;
this._y = _parent.homeY - 100;
forceFactor = 0.01;
balanceState = 0;
balanceCounter = 0;
balanceLimit = 20;
this.attachMovie('leeuw_total', 'leeuw_total', 1000200);
leeuw_total.gotoAndStop('stastil');
begin = 'wait';
}
frame 2 {
if (begin == 'wait') {
} else {
if (begin == 'go') {
leeuw_total.gotoAndPlay('omkijken');
if (_parent.soundReady()) {
_root.sound_mc.startmotor_snd.start(0, 1);
}
} else {
if (state != 'fall' & begin == false) {
this._x = _parent.homeX + _parent.auto.offsetX;
force = 0;
force += _parent.force;
force += _parent.auto.ontwijkForce;
balanceCounter -= force * forceFactor;
if (Key.isDown(40)) {
bukt = true;
} else {
bukt = false;
}
lean = false;
if (Key.isDown(37)) {
balanceCounter -= 3;
lean = true;
if (bukt) {
balanceCounter += 1.5;
lean = false;
}
}
if (Key.isDown(39)) {
balanceCounter += 3;
lean = true;
if (bukt) {
balanceCounter -= 1.5;
lean = false;
}
}
state = Math.round(balanceCounter / balanceLimit);
if (state <= -4 & _parent.cheat != 1) {
leeuwValt();
state = 'fall';
leeuw_total.gotoAndPlay('fall left');
} else {
if (state >= 4 & _parent.cheat != 1) {
leeuwValt();
state = 'fall';
leeuw_total.gotoAndPlay('fall right');
} else {
if (bukt != oldBukt || state != oldState || oldLean != lean) {
if (bukt == true) {
leeuw_total.gotoAndPlay('buk' + state);
} else {
if (lean == true & Math.abs(oldState) > Math.abs(state)) {
leeuw_total.gotoAndPlay('lean' + state);
} else {
leeuw_total.gotoAndPlay('stand' + state);
}
}
}
}
}
oldState = state;
oldBukt = bukt;
oldLean = lean;
}
_parent.balansbal._x = _parent.homeX + balanceCounter * 1.6;
}
}
if (state == 'fall') {
p = _root.spel_mc.hud.punten.punten;
if (p > 0) {
_root.spel_mc.hud.setPunten(p - 79);
} else {
_root.spel_mc.hud.setPunten(0);
}
}
}
frame 3 {
gotoAndPlay(_currentframe - 1);
}
}
movieClip 155 fieldObject {
frame 1 {
function die() {
var v1 = _parent;
var v2 = this;
i = 0;
while (i < v1.bosjesList.length) {
if (v2._name == v1.bosjesList[i]) {
v1.bosjesList.splice(i, 1);
break;
}
++i;
}
v2.removeMovieClip();
}
function getpos() {
var v1 = this;
var v2 = _parent;
y = 0.02 * (100 - dist) * (100 - dist) * ((100 - dist) / 100) * ((100 - dist) / 100);
x = mybocht * (dist / 100);
x += offsetX + y * offsetX / v2.diepteEffect;
v1._x = x + v2.awayX;
v1._y = y + v2.awayY;
v1._xscale = basicScale + scaleFactor * y;
v1._yscale = basicScale + scaleFactor * y;
}
}
frame 1 {
_parent.bosjesList.push(this._name);
var mybocht = _parent.difX + _parent.bochtX;
var scaleFactor = 1;
var basicScale = 10;
if (mybocht == 0) {
mybocht = 1;
}
var steilheid = -_parent.difY / mybocht * mybocht;
getpos();
specialObject = false;
if (graphic == 'bosje') {
graphic = _parent.zijkantlist[_parent.level - 1][random(_parent.zijkantlist[_parent.level - 1].length)];
}
if (graphic == 'bukken') {
specialObject = 'bukken';
graphic = _parent.buklist[_parent.level - 1][random(_parent.buklist[_parent.level - 1].length)];
}
if (graphic == 'ontwijken') {
graphic = _parent.ontwijklist[_parent.level - 1][random(_parent.ontwijklist[_parent.level - 1].length)];
if (graphic.substr(-5, 5) == 'links') {
specialObject = 'rechts';
} else {
specialObject = 'links';
}
}
if (graphic == 'poort') {
specialObject = 'bukken';
}
if (graphic == 'finalhuis') {
specialObject = 'bukken';
}
if (graphic == 'weglevel1' || graphic == 'weglevel2' || graphic == 'weglevel3') {
this.depth -= 1000;
}
gfx = this.attachMovie(graphic, 'myGraphic', _parent.depth);
force = _parent.bochtX;
finalDist = -10;
if (graphic == 'pechlinks' || graphic == 'pechrechts' || graphic == 'carvanlinks' || graphic == 'carvanrechts') {
finalDist = -30;
}
}
frame 2 {
dist -= _parent.speed;
getpos();
if ((graphic == 'weglevel1' || graphic == 'weglevel2' || graphic == 'weglevel3') & dist <= 30 & force != 0) {
_parent.force = force;
force = 0;
}
if (specialObject == 'bukken' & dist < 1 & _parent.cheat != true) {
if (_parent.leeuw.bukt != true || graphic == 'finalhuis') {
_parent.leeuw.knalTegenObject(this);
}
}
if ((specialObject == 'links' || specialObject == 'rechts') & dist < 20 & dist > -10 & _parent.auto.ontwijk == false) {
_parent.auto.gaOntwijken(specialObject);
}
if (graphic == 'leeuwstand') {
if (dist < 10 && myGraphic._currentframe == 1) {
if (_parent.soundReady()) {
_root.sound_mc.boing_snd.start();
}
myGraphic.gotoAndPlay(2);
}
}
if (graphic == 'flitspaal') {
if (dist < 5 && myGraphic._currentframe == 1) {
myGraphic.gotoAndPlay(2);
}
}
if (graphic == 'finalhuis') {
if (dist < 50 && myGraphic._currentframe == 1) {
myGraphic.gotoAndPlay(2);
}
}
if (dist < finalDist) {
die();
}
}
frame 3 {
gotoAndPlay(_currentframe - 1);
}
}
movieClip 157 body {
frame 1 {
stop();
}
frame 3 {
_parent._xscale += 10;
_parent._yscale += 10;
}
}
movieClip 162 rhinolinks {
}
movieClip 163 rhinorechts {
}
movieClip 164 grootbosje {
}
movieClip 166 weglevel3 {
}
movieClip 169 weglevel2 {
}
movieClip 171 weglevel1 {
}
movieClip 176 giraflinks {
}
movieClip 177 girafrechts {
}
movieClip 178 auto {
frame 1 {
function gaOntwijken(richting) {
ontwijk = true;
if (richting == 'links') {
ontwijkSpeed = -Math.abs(ontwijkSpeed);
} else {
ontwijkSpeed = Math.abs(ontwijkSpeed);
}
}
}
frame 1 {
this._x = _parent.homeX;
this._y = _parent.homeY - 20;
state = 'rijden';
ontwijk = false;
ontwijkForce = 0;
ontwijkCounter = 0;
ontwijkSpeed = 0.15;
ontwijkAfstand = 100;
ontwijkAantalStappen = 3.14 / ontwijkSpeed;
ontwijkFrameCurve = ontwijkAantalStappen / 7;
ontwijkStap = 0;
xscale = this._xscale;
yscale = this._yscale;
half = 0;
this.attachMovie('volvo_total', 'volvo_total', 1000012);
volvo_total.gotoAndStop('volvo0');
}
frame 2 {
if (state == 'wegrijden') {
ontwijk = false;
if (half == 0) {
this._x = _parent.roadRoute[0];
this._y = _parent.roadRoute[1];
_parent.roadRoute.splice(0, 2);
half = 1;
} else {
this._x = (this._x + _parent.roadRoute[0]) / 2;
this._y = (this._y + _parent.roadRoute[1]) / 2;
half = 0;
}
this._xscale = 0.5 * (this._y - _parent.awayY);
this._yscale = this._xscale;
if (_parent.roadRoute.length == 0) {
this.removeMovieClip();
}
}
if (ontwijk) {
ontwijkCounter += ontwijkSpeed;
sinusje = Math.sin(ontwijkCounter);
offsetX = ontwijkAfstand * sinusje;
if (ontwijkCounter < 1.57) {
ontwijkForce = 50;
} else {
ontwijkForce = -25;
}
if (ontwijkSpeed < 0) {
ontwijkForce = -ontwijkForce;
}
if (ontwijkCounter > 3.14 || ontwijkCounter < -3.14) {
ontwijk = false;
offsetX = 0;
ontwijkCounter = 0;
ontwijkForce = 0;
ontwijkStap = 0;
}
this._x = _parent.homeX + offsetX;
++ontwijkStap;
volvoFrame = Math.round(-3 + ontwijkStap / ontwijkFrameCurve);
if (volvoFrame > 3) {
volvoFrame = 3;
}
if (volvoFrame < -3) {
volvoFrame = -3;
}
if (ontwijkSpeed > 0) {
volvoFrame = -volvoFrame;
}
volvo_total.gotoAndStop('volvo' + volvoFrame);
_parent.leeuw._x = _parent.homeX + offsetX;
}
}
frame 3 {
gotoAndPlay(_currentframe - 1);
}
}
movieClip 190 level1 {
}
movieClip 195 level3 {
}
movieClip 201 level2 {
}
movieClip 204 highscore {
frame 1 {
this._x = 0;
this._y = 0;
punten = 926;
highscore = 'highscore (Karel): ' + punten;
}
frame 2 {
stop();
}
}
movieClip 206 punten {
frame 1 {
}
frame 1 {
this._x = 400;
this._y = 0;
punten = 0;
setPunten(punten);
}
frame 2 {
stop();
}
}
movieClip 207 hud {
frame 1 {
function setPunten(p) {
punten.punten = p;
punten.bericht = 'score: ' + p;
if (punten.punten > 7300 && highscore.punten != 99999) {
highscore.punten = 99999;
_parent.makeMessage('hsmessage');
if (_parent.soundReady()) {
_root.sound_mc.highscore_snd.start();
}
}
}
}
frame 1 {
this.attachMovie('hudbalken', 'hudbalken', 1000039);
this.attachMovie('punten', 'punten', 1000040);
this.attachMovie('highscore', 'highscore', 1000041);
this.attachMovie('soundswitcher', 'soundswitcher', 1000042);
highscore.bericht = 'highscore ' + _root.sender + ': 7213';
}
frame 3 {
gotoAndPlay(_currentframe - 1);
}
}
movieClip 210 bosje3 {
}
movieClip 213 bosje1 {
}
movieClip 216 bosje2 {
}
movieClip 224 volvo_total {
frame 1 {
stop();
}
}
movieClip 229 {
}
movieClip 230 zebrarechts {
frame 2 {
if (_parent.dist > 80) {
gotoAndPlay(_currentframe - 1);
}
}
frame 74 {
stop();
}
}
movieClip 231 zebralinks {
}
movieClip 233 balansmeter {
frame 1 {
this._x = 200;
this._y = 250;
}
}
movieClip 235 balansbal {
frame 1 {
this._x = 200;
this._y = 250;
}
}
movieClip 248 steenrechts {
}
movieClip 256 steenlinks {
}
movieClip 258 boom2rechts {
}
movieClip 314 poort {
}
movieClip 315 boom2links {
}
movieClip 334 boom1 {
}
movieClip 335 boom1links {
}
movieClip 336 boom1rechts {
}
movieClip 338 olifantlinks {
}
movieClip 339 olifantrechts {
}
movieClip 360 rots {
}
movieClip 373 boom3 {
}
movieClip 390 boom4 {
}
movieClip 392 lantaarnpaallinks {
}
movieClip 397 {
}
movieClip 399 werk1rechts {
}
movieClip 400 werk1links {
}
movieClip 402 pechlinks {
}
movieClip 403 pechrechts {
}
movieClip 405 carvanlinks {
}
movieClip 406 carvanrechts {
}
movieClip 408 blauwbordrechts {
}
movieClip 410 auto1links {
}
movieClip 411 auto1rechts {
}
movieClip 413 auto2links {
}
movieClip 414 auto2rechts {
}
movieClip 416 auto3links {
}
movieClip 417 auto3rechts {
}
movieClip 419 auto4links {
}
movieClip 420 auto4rechts {
}
movieClip 422 auto5links {
}
movieClip 423 auto5rechts {
}
movieClip 425 vrachtwagen1links {
}
movieClip 426 vrachtwagen1rechts {
}
movieClip 435 koe1 {
}
movieClip 444 koe2 {
}
movieClip 452 koe3 {
}
movieClip 458 koe4 {
}
movieClip 467 boerderij {
}
movieClip 474 lucht {
frame 1 {
stop();
}
}
movieClip 475 scrhino2 {
}
movieClip 476 scrhino {
}
movieClip 506 scgiraffe2 {
}
movieClip 507 scgiraffe {
}
movieClip 508 scolifant2 {
}
movieClip 509 scolifant {
}
movieClip 510 girafbg {
}
movieClip 592 zebrakudde {
}
movieClip 594 pizzalinks {
}
movieClip 595 pizzarechts {
}
movieClip 598 {
}
movieClip 599 brandweerlinks {
}
movieClip 600 brandweerrechts {
}
movieClip 603 {
}
movieClip 604 pliesielinks {
}
movieClip 605 pliesierechts {
}
movieClip 607 huis1links {
}
movieClip 608 huis1rechts {
}
movieClip 610 huis2links {
}
movieClip 611 huis2rechts {
}
movieClip 613 huis3links {
}
movieClip 614 huis3rechts {
}
movieClip 650 boompie4 {
}
movieClip 664 boompie3 {
}
movieClip 675 boompie2 {
}
movieClip 688 boompie1 {
}
movieClip 689 invisible {
}
movieClip 691 stoplichtrechts {
}
movieClip 692 stoplichtlinks {
}
movieClip 694 hudbalken {
}
movieClip 727 billboardrechts {
}
movieClip 750 billboardlinks {
}
movieClip 767 blauwbordrechts2 {
}
movieClip 779 pasopleeuw {
}
movieClip 783 finalhuis {
frame 1 {
stop();
}
frame 20 {
stop();
}
frame 35 {
stop();
}
}
movieClip 789 hsmessage {
frame 1 {
if (_root.sender == 'Tim') {
gotoAndStop('defaultSender');
} else {
gotoAndStop('setSender');
}
}
frame 2 {
stop();
}
frame 3 {
stop();
sendernaam.text = _root.sender;
}
}
button 792 {
on (release) {
if (_parent._parent.soundReady()) {
_root.sound_mc.muziekje_snd.stop();
_root.sound_mc.drive1_snd.stop();
_root.sound_mc.drive2_snd.stop();
_root.sound_mc.drive3_snd.stop();
_root.sound_mc.eindloop_snd.stop();
_root.sound_mc.startmotor_snd.stop();
}
_root.soundActive = false;
gotoAndStop('off');
}
}
button 794 {
on (release) {
_root.soundActive = true;
if (_parent._parent.soundReady()) {
_root.sound_mc.muziekje_snd.start(0, 999);
_root.sound_mc.drive1_snd.start(0, 999);
}
gotoAndStop('on');
}
}
movieClip 795 soundswitcher {
frame 1 {
if (_root.soundActive == false) {
gotoAndPlay('off');
}
}
frame 2 {
stop();
}
frame 3 {
stop();
}
}
movieClip 797 werk2links {
}
movieClip 798 werk2rechts {
}
movieClip 805 {
}
movieClip 806 oudemolen {
}
movieClip 811 {
}
movieClip 812 nieuwemolen {
}
movieClip 813 NOTHING {
}
movieClip 820 highscorelist {
frame 70 {
_parent.leeuw.begin = 'go';
this.removeMovieClip();
}
}
frame 1 {
function soundReady() {
var v1 = _parent;
if (v1.soundActive == true) {
return v1.sound_mc != undefined && v1.sound_mc.getBytesLoaded() >= v1.sound_mc.getBytesTotal();
}
return false;
}
function switchSoundActive() {
if (soundActive) {
} else {}
}
}
frame 1 {
stop();
}
button 824 {
on (release) {
_parent.gotoAndStop('empty');
++_parent.playCounter;
gotoAndPlay(_currentframe + 1);
}
}
frame 2 {
function goKillGame() {
var v1 = this;
var v2 = _root;
if (laatsteStuk == true) {
v2.gotoAndPlay('helaas');
v1.removeMovieClip();
} else {
j = 0;
while (j < bosjesList.length) {
fieldItem = bosjesList[j];
v1[fieldItem].removeMovieClip();
++j;
}
leeuw.removeMovieClip();
auto.removeMovieClip();
skyline.removeMovieClip();
lucht.removeMovieClip();
balansmeter.removeMovieClip();
balansbal.removeMovieClip();
hud.removeMovieClip();
v2.sound_mc.muziekje_snd.stop(0);
v2.sound_mc.eindloop_snd.stop(0);
++_parent.playCounter;
gotoAndPlay(2);
}
}
function makebosje(itemType, newOffsetX, newDist) {
var v1 = newOffsetX;
var v2 = itemType;
var v3 = this;
depthOffset = 0;
if (v2 == 'weglevel1' || v2 == 'weglevel2' || v2 == 'weglevel3') {
depthOffset = -1000;
}
newFieldObject = v2 + String(depth--);
v3.attachMovie('fieldObject', newFieldObject, depth + depthOffset);
if (v2 == 'rots' & Math.abs(v1) < 100) {
v1 *= 2;
}
if (v2 == 'boerderij' & Math.abs(v1) < 80) {
v1 *= 2;
}
if (v2 == 'billboardlinks') {
v1 = -40;
}
if (v2 == 'billboardrechts') {
v1 = 40;
}
if (v2 == 'flitspaal') {
v1 = 16;
}
if (v2 == 'pasopleeuw') {
v1 = 16;
}
if (v2 == 'oudemolen' & Math.abs(v1) < 70) {
v1 *= 2;
}
if (v2 == 'nieuwemolen' & Math.abs(v1) < 70) {
v1 *= 2;
}
v3[newFieldObject].offsetX = v1;
v3[newFieldObject].dist = newDist;
v3[newFieldObject].graphic = v2;
}
function buildRoad(lengte) {
var v1 = lengte;
minStuk = 30;
maxStuk = 100;
minScherpte = 20;
maxScherpte = 30;
roadTypes = ['rechtdoor', 'links', 'rechts'];
road = [];
totaleLengte = 0;
stukType = '';
vorigeStukType = '';
while (totaleLengte < v1 - 2 * maxStuk) {
stukLengte = minStuk + random(maxStuk - minStuk);
stukScherpte = minScherpte + random(maxScherpte - minScherpte);
vorigeStukType = stukType;
while (stukType == vorigeStukType) {
stukType = roadTypes[random(roadTypes.length)];
}
if (totaleLengte > v1 * 0.33 & totaleLengte < v1 * 0.66) {
stukScherpte /= 2;
if (stukType == 'rechtdoor') {
stukLengte *= 3;
}
}
totaleLengte += stukLengte;
road.push([totaleLengte, stukType, stukScherpte]);
}
road.push([totaleLengte + minStuk, 'rechtdoor', maxScherpte]);
return road;
}
function buildObjects(lengte) {
var v1 = lengte;
objecten = [['bukken', 10], ['ontwijken', 25]];
moeilijkheidsCurve = 25;
plaatsingsMarge = 30;
tmp = [];
x = 0;
while (x < objecten.length) {
c = 1;
while (c <= objecten[x][1]) {
tmp.push(objecten[x][0]);
++c;
}
++x;
}
tmp = shuffleArray(tmp);
aantalObjecten = tmp.length;
gemiddeldeAfstand = Math.round(v1 / aantalObjecten);
afnameInProcenten = moeilijkheidsCurve * 2 / aantalObjecten;
objects = [];
afstandTotaal = 0;
x = 0;
while (x < aantalObjecten) {
item = tmp[x];
procentueelVerschil = moeilijkheidsCurve - afnameInProcenten * x;
afstand = gemiddeldeAfstand + (gemiddeldeAfstand / 100) * procentueelVerschil;
afstandTotaal += afstand;
if (afstandTotaal < v1 * 0.4 - gemiddeldeAfstand || afstandTotaal > v1 * 0.4 + gemiddeldeAfstand) {
if (afstandTotaal < v1 * 0.77 - gemiddeldeAfstand || afstandTotaal > v1 * 0.77 + gemiddeldeAfstand) {
objects.push([afstandTotaal, item]);
}
}
++x;
}
return objects;
}
function shuffleArray(anArray) {
var v1 = anArray;
tmp = [];
total = v1.length;
x = 0;
while (x < total) {
nr = random(v1.length);
tmp.push(v1[nr]);
v1.splice(nr, 1);
++x;
}
return tmp;
}
function getRoadRoute() {
var v1 = this;
roadRoute = [];
j = 0;
while (j < bosjesList.length - 1) {
fieldItem = bosjesList[j];
itemType = v1[fieldItem].graphic;
if (itemType == 'weglevel1' || itemType == 'weglevel2' || itemType == 'weglevel3') {
roadRoute.push(v1[fieldItem]._x);
roadRoute.push(v1[fieldItem]._y);
}
++j;
}
roadRoute.splice(0, 8);
auto.state = 'wegrijden';
}
function makeMessage(txt) {
this.attachMovie('levelmessage', 'levelmessage', 1000100);
levelmessage.graphic = txt;
}
_root.sound_mc.startmotor_snd.onSoundComplete = function () {
if (soundReady()) {
_root.sound_mc.drive1_snd.start(0, 999);
}
};
_root.sound_mc.muziekje_snd.onSoundComplete = function () {
if (soundReady()) {
_root.sound_mc.eindloop_snd.start(0, 999);
}
};
}
frame 2 {
var bosjesList = new Array();
var awayX = 200;
var awayY = 80;
var homeX = 200;
var homeY = 330;
var difX = awayX - homeX;
var difY = awayY - homeY;
var distance = 0;
var speed = 0;
var bochtX = 0;
var maxBochtX = 150;
var bosjesAfstand = 5;
var bosjesAfstandCounter = 0;
var diepteEffect = 18;
var breedteWeg = 30;
var randomLocaties = Array(-120, -110, -100, -90, -80, -70, -60, -50, -40, 40, 50, 60, 70, 80, 90, 100, 110, 120);
var depth = 1000000;
var force = 0;
var step = 0;
var level = 1;
var lboom3 = 0;
boompiesList = ['boompie2', 'boompie3', 'boompie4'];
huisList = ['huis1links', 'huis2links'];
laatsteStuk = false;
pbleeuw = false;
level1Speed = 2;
level2Speed = 2.5;
level3Speed = 1.7;
targetSpeed = 0;
accelerateSpeed = 0.01;
buklist = [];
buklist.push(['boom1links', 'boom1rechts', 'boom2links', 'boom2rechts', 'giraflinks', 'girafrechts']);
buklist.push(['blauwbordrechts', 'blauwbordrechts2']);
buklist.push(['stoplichtlinks', 'stoplichtrechts']);
ontwijklist = [];
ontwijklist.push(['zebrarechts', 'zebralinks', 'rhinolinks', 'rhinorechts', 'steenlinks', 'steenrechts']);
ontwijklist.push(['werk2links', 'werk2rechts', 'werk1links', 'werk1rechts', 'pechlinks', 'pechrechts', 'carvanlinks', 'carvanrechts', 'vrachtwagen1links', 'vrachtwagen1rechts', 'auto1links', 'auto1rechts', 'auto2links', 'auto2rechts', 'auto3links', 'auto3rechts', 'auto4links', 'auto4rechts', 'auto5links', 'auto5rechts']);
ontwijklist.push(['pliesielinks', 'pliesierechts', 'brandweerlinks', 'brandweerrechts', 'pizzalinks', 'pizzarechts', 'pizzalinks', 'pizzarechts']);
zijkantlist = [];
zijkantlist.push(['bosje1', 'bosje2', 'bosje3']);
zijkantlist.push(['bosje1', 'bosje2', 'bosje3']);
zijkantlist.push(['boompie2', 'boompie3', 'boompie4']);
scenerylist = [];
scenerylist.push(['pasopleeuw', 'boom3', 'boom4', 'boom3', 'boom4', 'boom3', 'boom4', 'boom3', 'boom4', 'boom3', 'boom4', 'safaribos1', 'safaribos2', 'safaribos1', 'safaribos2', 'safaribos1', 'safaribos2', 'rots', 'scrhino', 'scgiraffe', 'scolifant', 'scrhino2', 'scgiraffe2', 'scolifant2', 'zebrakudde', 'zebrakudde']);
scenerylist.push(['nieuwemolen', 'nieuwemolen', 'nieuwemolen', 'nieuwemolen', 'oudemolen', 'oudemolen', 'flitspaal', 'billboardlinks', 'billboardrechts', 'boerderij', 'koe1', 'koe2', 'koe3', 'koe4', 'koe1', 'koe2', 'koe3', 'koe4', 'koe1', 'koe2', 'koe3', 'koe4']);
scenerylist.push(['NOTHING']);
var lengte = 5450;
var road = buildRoad(lengte);
var objects = buildObjects(lengte);
attachMovie('auto', 'auto', 1000010);
attachMovie('leeuw', 'leeuw', 1000020);
attachMovie('skyline', 'skyline', 10);
attachMovie('lucht', 'lucht', 1);
attachMovie('hud', 'hud', 1000030);
attachMovie('balansmeter', 'balansmeter', 1000400);
attachMovie('balansbal', 'balansbal', 1000401);
x = -1;
while (x <= 20) {
makebosje('weglevel1', 0, x * 10 / 2);
if (x % 3 == 0) {
makebosje('bosje', -breedteWeg / 2, x * 10 / 2);
makebosje('bosje', breedteWeg / 2, x * 10 / 2);
}
++x;
}
cheat = false;
attachMovie('highscorelist', 'highscorelist', 1000567);
_root.sound_mc.muziekje_snd.stop();
if (soundReady()) {
_root.sound_mc.muziekje_snd.start(0, 0);
}
gotoAndPlay(_currentframe + 1);
}
frame 3 {
distance += speed;
bosjesAfstandCounter += speed;
if (bosjesAfstandCounter > bosjesAfstand && !laatsteStuk) {
++step;
if (step > 0 & level == 1) {
makebosje('weglevel1', 0, 100);
}
if (step > 0 & level == 2) {
makebosje('weglevel2', 0, 100);
}
if (step > 0 & level == 3) {
makebosje('weglevel3', 0, 100);
}
if (step == 2 & level == 1) {
makebosje('bosje', -breedteWeg / 2, 100);
makebosje('bosje', breedteWeg / 2, 100);
}
if (step == 4 & level == 2) {
makebosje('lantaarnpaallinks', -breedteWeg / 2, 100);
}
++l3boom;
if (level == 3 & l3boom > 7) {
makebosje('boompie3', -breedteWeg / 2, 100);
makebosje('boompie2', breedteWeg / 2, 100);
l3boom = 0;
}
if (level == 3 & step == 2) {
if (random(10) < 5) {
makebosje('huis1links', -breedteWeg * 2, 100);
makebosje('huis2rechts', breedteWeg * 2, 100);
} else {
makebosje('huis2links', -breedteWeg * 2, 100);
makebosje('huis1rechts', breedteWeg * 2, 100);
}
}
if (level == 3 & (step == 2 || step == 4)) {
makebosje('huis3links', -breedteWeg * 5, 100);
makebosje('huis3rechts', breedteWeg * 5, 100);
}
if (step == 4) {
step = 0;
}
bosjesAfstandCounter -= bosjesAfstand;
if (distance >= road[0][0]) {
road.splice(0, 1);
}
if (road[0][1] == 'links' & bochtX > -maxBochtX) {
bochtX -= road[0][2];
}
if (road[0][1] == 'rechts' & bochtX < maxBochtX) {
bochtX += road[0][2];
}
if (road[0][1] == 'rechtdoor') {
if (bochtX > 0) {
bochtX -= road[0][2];
}
if (bochtX < 0) {
bochtX += road[0][2];
}
}
if (level == 1 & distance > lengte * 0.4) {
level = 2;
makeMessage('level2');
makebosje('poort', 0, 100);
targetSpeed = level2Speed;
if (soundReady()) {
_root.sound_mc.drive1_snd.stop();
}
if (soundReady()) {
_root.sound_mc.drive2_snd.start(0, 999);
}
if (soundReady()) {
_root.sound_mc.level_snd.start();
}
lucht.gotoAndStop('level2');
skyline.gotoAndPlay('level2');
}
if (level == 2 & distance > lengte * 0.75) {
level = 3;
makeMessage('level3');
targetSpeed = level3Speed;
if (soundReady()) {
sound_mc.drive2_snd.stop();
}
if (soundReady()) {
sound_mc.drive1_snd.start(0, 999);
}
if (soundReady()) {
_root.sound_mc.level_snd.start();
}
lucht.gotoAndStop('level3');
skyline.gotoAndPlay('level3');
}
if (level == 3 && pbleeuw == false && distance > lengte * 0.77) {
pbleeuw = 'active';
makebosje('leeuwstand', -5, 100);
}
if (distance < lengte) {
hud.setPunten(Math.round(distance * 8600 / lengte));
}
if (!auto.ontwijk) {
volvoFrame = Math.round(force / 70);
auto.volvo_total.gotoAndStop('volvo' + volvoFrame);
}
if (distance >= lengte) {
makebosje('finalhuis', 0, 100);
laatsteStuk = true;
}
}
if (distance >= objects[0][0]) {
makebosje(objects[0][1], 0, 100);
objects.splice(0, 1);
}
if (speed < targetSpeed) {
speed += accelerateSpeed;
}
if (speed > targetSpeed) {
speed -= accelerateSpeed;
}
if (random(30) < speed * 2) {
makebosje(scenerylist[level - 1][random(scenerylist[level - 1].length)], randomLocaties[random(randomLocaties.length)], 100);
}
}
frame 4 {
gotoAndPlay(_currentframe - 1);
}