Frame 1
play();
function setvolume(v) {
trace("set volume called by game - level " + v);
toy.game.setvolume();
}
function replay() {
toy.p1buttons._visible = true;
if (_level0.players == 2) {
toy.p2buttons._visible = true;
}
toy.game.playedonce = true;
toy.game.gotoAndPlay(1);
toy.game.mygameoverbox.removeMovieClip();
}
function keycheck(keychar, keynum) {
if ((1 < keynum) and (p1leftkeychar eq keychar)) {
return(false);
}
if ((2 < keynum) and (p1middlekeychar eq keychar)) {
return(false);
}
if ((3 < keynum) and (p1rightkeychar eq keychar)) {
return(false);
}
if ((4 < keynum) and (p2leftkeychar eq keychar)) {
return(false);
}
if ((5 < keynum) and (p2middlekeychar eq keychar)) {
return(false);
}
return(true);
}
Frame 2
if (this.getBytesLoaded() == this.getBytesTotal()) {
gotoAndPlay (4);
}
Frame 3
gotoAndPlay (2);
Frame 4
if (_level0.online == 1) {
_level0.gamepreloader.gotoAndStop(1);
gotoAndStop (6);
} else {
gotoAndStop (16);
}
Frame 6
stop();
_root.loaded = 1;
p1leftkeychar = _level0.p1leftkeychar;
p1middlekeychar = _level0.p1middlekeychar;
p1rightkeychar = _level0.p1rightkeychar;
p2leftkeychar = _level0.p2leftkeychar;
p2middlekeychar = _level0.p2middlekeychar;
p2rightkeychar = _level0.p2rightkeychar;
toy.p1buttons.leftkey.letter = p1leftkeychar;
toy.p1buttons.middlekey.letter = p1middlekeychar;
toy.p1buttons.rightkey.letter = p1rightkeychar;
toy.p2buttons.leftkey.letter = p2leftkeychar;
toy.p2buttons.middlekey.letter = p2middlekeychar;
toy.p2buttons.rightkey.letter = p2rightkeychar;
Frame 16
globalvolume = 100;
p1leftkeychar = "Z";
p1middlekeychar = "X";
p1rightkeychar = "C";
p2leftkeychar = "J";
p2middlekeychar = "K";
p2rightkeychar = "L";
toy.p1buttons.leftkey.letter = p1leftkeychar;
toy.p1buttons.middlekey.letter = p1middlekeychar;
toy.p1buttons.rightkey.letter = p1rightkeychar;
toy.p2buttons.leftkey.letter = p2leftkeychar;
toy.p2buttons.middlekey.letter = p2middlekeychar;
toy.p2buttons.rightkey.letter = p2rightkeychar;
Symbol 30 MovieClip Frame 5
stop();
Symbol 31 MovieClip Frame 10
stop();
Symbol 45 MovieClip [correctp1] Frame 1
function correct() {
gotoAndPlay (10);
}
function wrong() {
gotoAndPlay (20);
}
stop();
Symbol 45 MovieClip [correctp1] Frame 18
gotoAndStop (2);
Symbol 45 MovieClip [correctp1] Frame 20
if (_x < 0) {
splash._xscale = -splash._xscale;
_x = (_x - 15);
} else {
_x = (_x + 10);
}
Symbol 45 MovieClip [correctp1] Frame 31
_parent.wrong.start();
Symbol 45 MovieClip [correctp1] Frame 41
gotoAndStop (2);
Symbol 52 MovieClip [correctp2] Frame 1
function correct() {
gotoAndPlay (10);
}
function wrong() {
gotoAndPlay (20);
}
stop();
Symbol 52 MovieClip [correctp2] Frame 18
gotoAndStop (2);
Symbol 52 MovieClip [correctp2] Frame 20
if (_x < 0) {
splash._xscale = -splash._xscale;
}
Symbol 52 MovieClip [correctp2] Frame 31
_parent.wrong.start();
Symbol 52 MovieClip [correctp2] Frame 40
gotoAndStop (2);
Symbol 66 MovieClip Frame 1
stop();
Symbol 67 MovieClip [scoreboard] Frame 1
function reset() {
p1score1 = 0;
p2score1 = 0;
p1scoretext = "00000";
p2scoretext = "00000";
aimscore1 = 0;
aimscore2 = 0;
currentscore = 1;
if (_parent.players == 2) {
p2icon.gotoAndStop(2);
} else {
p2icon.gotoAndStop(3);
}
}
function addscore(player, score) {
if (score ne "FOUL") {
if (player == 0) {
player = 2;
}
if (player == 1) {
aimscore1 = aimscore1 + score;
} else {
aimscore2 = aimscore2 + score;
}
if (aimscore1 < 0) {
aimscore1 = 0;
}
if (aimscore2 < 0) {
aimscore2 = 0;
}
this.attachMovie("addscoreclip", "addscoreclip", 9002);
}
}
function nextround() {
if (!_parent.demonstration) {
currentscore++;
trace("next round is " + currentscore);
if (currentscore >= 4) {
trace("calling gameover");
_parent.gameover();
}
}
}
function averagescore(player) {
returnscore = 0;
i = 1;
while (3 >= i) {
scorename = (("p" + player) + "score") + i;
if (0 < eval (scorename)) {
returnscore = returnscore + eval (scorename);
}
i++;
}
return(returnscore / 3);
}
reset();
stop();
Symbol 67 MovieClip [scoreboard] Frame 40
gotoAndStop (2);
Symbol 67 MovieClip [scoreboard] Frame 75
gotoAndStop (2);
Symbol 70 MovieClip Frame 8
animation.stop();
_parent.canhit = true;
stop();
Symbol 70 MovieClip Frame 9
animation.prevFrame();
animation.prevFrame();
Symbol 70 MovieClip Frame 10
animation.prevFrame();
animation.prevFrame();
Symbol 70 MovieClip Frame 11
animation.prevFrame();
Symbol 70 MovieClip Frame 12
animation.prevFrame();
Symbol 70 MovieClip Frame 13
animation.prevFrame();
Symbol 70 MovieClip Frame 14
animation.prevFrame();
Symbol 70 MovieClip Frame 15
_parent.removeMovieClip();
Symbol 71 MovieClip [symbol] Frame 1
canhit = false;
initialscore = 400;
Symbol 71 MovieClip [symbol] Frame 2
diffy = aimy - _y;
_y = (_y + (diffy / 6));
if (0 < initialscore) {
initialscore = initialscore - 2;
}
if (canhit) {
p1result = this.hitTest(_parent.player1.orb);
p2result = this.hitTest(_parent.player2.orb);
}
if (p1result) {
trace("p1 hit");
_parent.nextsymbol();
_parent.scoreboard.addscore(1, initialscore);
canhit = false;
_parent.correctp1._x = _x;
_parent.correctp1._y = _y;
_parent.correctp1.correct();
_parent.correct.start();
animation.play();
stop();
} else if (p2result) {
trace("p2 hit");
_parent.nextsymbol();
_parent.scoreboard.addscore(2, initialscore);
canhit = false;
_parent.correctp2._x = _x;
_parent.correctp2._y = _y;
_parent.correctp2.correct();
_parent.correct.start();
animation.play();
stop();
}
Symbol 71 MovieClip [symbol] Frame 3
gotoAndPlay (2);
Symbol 73 MovieClip Frame 1
function setlocal() {
point = new object();
if (_level0.online == 1) {
point.x = _parent._parent.aimx + 450;
point.y = _parent._parent.aimy + 200;
} else {
point.x = _parent._parent.aimx + 245;
point.y = _parent._parent.aimy + 200;
}
globalToLocal(point);
_parent.localx = point.x;
_parent.localy = point.y;
}
Symbol 78 MovieClip Frame 1
stop();
Symbol 94 MovieClip Frame 1
stop();
Symbol 95 MovieClip [player] Frame 1
function mod(num) {
if (num < 0) {
return(-num);
}
return(num);
}
function inwater() {
if (playerone) {
_parent.correctp1._x = _x;
_parent.correctp1._y = _y;
_parent.correctp1.wrong();
} else {
_parent.correctp2._x = _x;
_parent.correctp2._y = _y;
_parent.correctp2.wrong();
}
_parent.splash.start();
_visible = false;
this.attachMovie("resetplayer", "resetplayer", 6666);
stop();
}
function nextmove() {
_x = (_x + xmom);
_y = (_y + ymom);
if (stagewidth < _x) {
inwater();
}
if (_x < (-stagewidth)) {
inwater();
}
if (stageheight < _y) {
_y = ((stageheight * 2) - _y);
ymom = -ymom;
_parent.boing.start();
}
if (_y < (-stageheight)) {
_y = (((-stageheight) * 2) - _y);
ymom = -ymom;
_parent.boing.start();
}
xmom = xmom * friction;
ymom = ymom * friction;
}
function resetrotation(degree) {
top._rotation = degree;
bottom._rotation = degree;
}
rotationrate = 8;
acceleration = 0.8;
maxspeed = 9;
friction = 0.95;
radius = 14;
stagewidth = 155;
stageheight = 120;
stagewidth = stagewidth - radius;
stageheight = stageheight - radius;
if (_name eq "player1") {
playerone = true;
orb.gotoAndStop(2);
} else {
top.gotoAndStop(2);
}
Symbol 95 MovieClip [player] Frame 2
if ((ai and (-200 < _parent.aimx)) and (demoframe == 0)) {
bottom.setlocal();
if (3 < mod(localy)) {
if (localy < 0) {
top._rotation = top._rotation - rotationrate;
bottom._rotation = bottom._rotation - rotationrate;
if (_parent.demonstration) {
_parent._parent.p1buttons.leftkey.demohitbutton();
}
} else {
top._rotation = top._rotation + rotationrate;
bottom._rotation = bottom._rotation + rotationrate;
if (_parent.demonstration) {
_parent._parent.p1buttons.rightkey.demohitbutton();
}
}
}
if (0 < localx) {
top.center.play();
if (Math.sqrt((xmom * xmom) + (ymom * ymom)) < (maxspeed * difficulty)) {
xmom = xmom + (Math.cos((top._rotation / 180) * 3.14) * acceleration);
ymom = ymom + (Math.sin((top._rotation / 180) * 3.14) * acceleration);
if (_parent.demonstration) {
_parent._parent.p1buttons.middlekey.demohitbutton();
}
}
} else {
top.center.gotoAndStop(1);
}
}
if (ai and (_parent.aimx < -200)) {
top.center.gotoAndStop(1);
}
if (ai and (0 < demoframe)) {
if (demoframe == 2) {
_parent.keyclick.start();
_parent._parent.p1buttons.leftkey.dontreset = true;
_parent._parent.p1buttons.leftkey.demohitbutton();
}
if (demoframe == 63) {
_parent.keyclick.start();
_parent._parent.p1buttons.leftkey.dontreset = false;
_parent._parent.p1buttons.leftkey.gotoAndStop(2);
_parent._parent.p1buttons.rightkey.dontreset = true;
_parent._parent.p1buttons.rightkey.demohitbutton();
}
if (demoframe == 124) {
_parent.keyclick.start();
_parent._parent.p1buttons.rightkey.dontreset = false;
_parent._parent.p1buttons.rightkey.gotoAndStop(2);
_parent._parent.p1buttons.middlekey.dontreset = true;
_parent._parent.p1buttons.middlekey.demohitbutton();
}
if (demoframe == 180) {
_parent._parent.p1buttons.middlekey.dontreset = false;
_parent._parent.p1buttons.middlekey.gotoAndStop(2);
}
if (demoframe < 63) {
top._rotation = top._rotation - rotationrate;
bottom._rotation = bottom._rotation - rotationrate;
} else if (demoframe < 124) {
top._rotation = top._rotation + rotationrate;
bottom._rotation = bottom._rotation + rotationrate;
} else if (demoframe < 130) {
xmom = xmom + (Math.cos((top._rotation / 180) * 3.14) * acceleration);
ymom = ymom + (Math.sin((top._rotation / 180) * 3.14) * acceleration);
}
demoframe++;
if (130 < demoframe) {
demoframe = 0;
_parent.nextsymbol();
}
}
nextmove();
if (keysenabled) {
if (Key.isDown(leftkeychar.charCodeAt(0))) {
top._rotation = top._rotation - rotationrate;
bottom._rotation = bottom._rotation - rotationrate;
if (playerone) {
_parent._parent.p1buttons.leftkey.hitbutton();
} else {
_parent._parent.p2buttons.leftkey.hitbutton();
}
}
if (Key.isDown(rightkeychar.charCodeAt(0))) {
top._rotation = top._rotation + rotationrate;
bottom._rotation = bottom._rotation + rotationrate;
if (playerone) {
_parent._parent.p1buttons.rightkey.hitbutton();
} else {
_parent._parent.p2buttons.rightkey.hitbutton();
}
}
if (Key.isDown(middlekeychar.charCodeAt(0))) {
top.center.play();
if (playerone) {
_parent._parent.p1buttons.middlekey.hitbutton();
} else {
_parent._parent.p2buttons.middlekey.hitbutton();
}
if (Math.sqrt((xmom * xmom) + (ymom * ymom)) < maxspeed) {
xmom = xmom + (Math.cos((top._rotation / 180) * 3.14) * acceleration);
ymom = ymom + (Math.sin((top._rotation / 180) * 3.14) * acceleration);
}
} else {
top.center.gotoAndStop(1);
}
}
if (Key.isDown(Key.SPACE)) {
trace("space pressed");
if (_parent.demonstration) {
_parent.demomovie.removeMovieClip();
_parent.reset(_parent.players);
}
}
Symbol 95 MovieClip [player] Frame 3
gotoAndPlay (2);
Symbol 98 Button
on (release) {
_parent._parent.gotoAndStop(1);
_parent.removeme();
}
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut, releaseOutside) {
this.gotoAndStop(1);
}
Symbol 104 MovieClip Frame 1
stop();
Symbol 121 MovieClip Frame 1
stop();
Symbol 163 MovieClip Frame 31
stop();
Symbol 164 MovieClip [gameoverbox] Frame 1
function removeme() {
this.removeMovieClip();
}
p1scorecard.score = "total: " + p1score;
p2scorecard.score = "total: " + p2score;
if (_parent.gameplayers == 2) {
p2scorecard.players.gotoAndStop(2);
} else {
p2scorecard.players.gotoAndStop(3);
}
if (p1score < p2score) {
rosette._x = -rosette._x;
}
if (p2score == p1score) {
rosette._visible = false;
}
if (_level0.online == 1) {
playagainbutton._visible = false;
p1scorecard._y = p1scorecard._y + 5.7;
p2scorecard._y = p2scorecard._y + 5.7;
_parent._parent.p1buttons._visible = false;
_parent._parent.p2buttons._visible = false;
}
Symbol 164 MovieClip [gameoverbox] Frame 59
if ((!_level0.tournament) == 1) {
_level0.nextgame(_parent.players, p1score, p2score);
}
Symbol 164 MovieClip [gameoverbox] Frame 201
if (_level0.tournament == 1) {
_level0.nextgame(_parent.gameplayers, p1score, p2score);
}
Symbol 164 MovieClip [gameoverbox] Frame 404
if (_level0.online == 1) {
} else {
_parent.gotoAndStop(1);
this.removeMovieClip();
}
stop();
Symbol 167 MovieClip [computerai] Frame 1
trace("difficulty is " + difficulty);
currentaction2 = 1;
Symbol 167 MovieClip [computerai] Frame 2
if ((currentaction2 == 1) and (!_parent._parent.gameisover)) {
hitchance = hitchance + (difficulty * random(3));
if (100 < hitchance) {
hitchance = hitchance - 100;
_parent.incrementvalue();
if (_parent._parent.demonstration) {
if (hitleftkey) {
if (_parent._name eq "player1movie") {
_parent._parent._parent.p1buttons.leftkey.demohitbutton();
} else {
_parent._parent._parent.p2buttons.leftkey.demohitbutton();
}
} else if (_parent._name eq "player1movie") {
_parent._parent._parent.p1buttons.rightkey.demohitbutton();
} else {
_parent._parent._parent.p2buttons.rightkey.demohitbutton();
}
hitleftkey = !hitleftkey;
}
}
}
if (currentaction2 == 2) {
if (_parent._parent.demonstration) {
trace("pressing middle key");
_parent._parent.p1buttons.middlekey.hitbutton();
}
_parent.incrementangle();
}
Symbol 167 MovieClip [computerai] Frame 3
gotoAndPlay (2);
Symbol 178 MovieClip [demomovie] Frame 329
_parent.reset(_parent.players);
this.removeMovieClip();
Symbol 199 MovieClip [readygo] Frame 6
_parent.traffic1.start();
Symbol 199 MovieClip [readygo] Frame 19
_parent.traffic1.start();
Symbol 199 MovieClip [readygo] Frame 32
_parent.traffic2.start();
_parent.timerclip.reset();
_parent.loop.start(0, 1000);
_parent.player1.play();
_parent.player2.play();
_parent.gameisover = false;
Symbol 199 MovieClip [readygo] Frame 40
this.removeMovieClip();
Symbol 200 MovieClip [addscoreclip] Frame 1
zerostring = "00000";
Symbol 200 MovieClip [addscoreclip] Frame 2
diff1 = _parent.aimscore1 - _parent.p1score1;
diff2 = _parent.aimscore2 - _parent.p2score1;
if ((diff1 == 0) and (diff2 == 0)) {
this.removeMovieClip();
}
if (0 < diff1) {
index1 = Math.floor(diff1 / 1000);
index2 = Math.floor(diff1 / 100) - (index1 * 10);
index3 = (Math.floor(diff1 / 10) - (index1 * 100)) - (index2 * 10);
index4 = ((diff1 - (index1 * 1000)) - (index2 * 100)) - (index3 * 10);
if (0 < index4) {
_parent.p1score1 = _parent.p1score1 + 1;
} else if (0 < index3) {
_parent.p1score1 = _parent.p1score1 + 10;
} else if (0 < index2) {
_parent.p1score1 = _parent.p1score1 + 100;
} else if (0 < index1) {
_parent.p1score1 = _parent.p1score1 + 1000;
}
}
if (0 < diff2) {
index1 = Math.floor(diff2 / 1000);
index2 = Math.floor(diff2 / 100) - (index1 * 10);
index3 = (Math.floor(diff2 / 10) - (index1 * 100)) - (index2 * 10);
index4 = ((diff2 - (index1 * 1000)) - (index2 * 100)) - (index3 * 10);
if (0 < index4) {
_parent.p2score1 = _parent.p2score1 + 1;
} else if (0 < index3) {
_parent.p2score1 = _parent.p2score1 + 10;
} else if (0 < index2) {
_parent.p2score1 = _parent.p2score1 + 100;
} else if (0 < index1) {
_parent.p2score1 = _parent.p2score1 + 1000;
}
}
if (diff1 < 0) {
index1 = 0;
index2 = Math.floor(diff1 / 100) - (index1 * 10);
index3 = (Math.floor(diff1 / 10) - (index1 * 100)) - (index2 * 10);
index4 = ((diff1 - (index1 * 1000)) - (index2 * 100)) - (index3 * 10);
if (index4 < 0) {
_parent.p1score1 = _parent.p1score1 - 1;
} else if (index3 < 0) {
_parent.p1score1 = _parent.p1score1 - 10;
} else if (index2 < 0) {
_parent.p1score1 = _parent.p1score1 - 100;
} else if (index1 < 0) {
_parent.p1score1 = _parent.p1score1 - 1000;
}
}
if (diff2 < 0) {
index1 = 0;
index2 = Math.floor(diff2 / 100) - (index1 * 10);
index3 = (Math.floor(diff2 / 10) - (index1 * 100)) - (index2 * 10);
index4 = ((diff2 - (index1 * 1000)) - (index2 * 100)) - (index3 * 10);
if (index4 < 0) {
_parent.p2score1 = _parent.p2score1 - 1;
} else if (index3 < 0) {
_parent.p2score1 = _parent.p2score1 - 10;
} else if (index2 < 0) {
_parent.p2score1 = _parent.p2score1 - 100;
} else if (index1 < 0) {
_parent.p2score1 = _parent.p2score1 - 1000;
}
}
numlength = length(_parent.p1score1);
_parent.p1scoretext = zerostring.substr(0, 5 - numlength) + _parent.p1score1;
numlength = length(_parent.p2score1);
_parent.p2scoretext = zerostring.substr(0, 5 - numlength) + _parent.p2score1;
Symbol 200 MovieClip [addscoreclip] Frame 4
gotoAndPlay (2);
Symbol 201 MovieClip [gameovertimer] Frame 100
_parent.gameoverbox();
this.removeMovieClip();
Symbol 202 MovieClip [resetplayer] Frame 1
_parent._y = -200;
_parent.ymom = 0;
_parent.xmom = 0;
_parent._x = 110 - random(220);
_parent._visible = true;
playerspin = 20;
ymom = 8;
friction = 0.95;
Symbol 202 MovieClip [resetplayer] Frame 2
resetframe++;
if (resetframe < 60) {
} else if (resetframe < 100) {
playerspin = playerspin * 0.95;
_parent._y = _parent._y + ymom;
ymom = ymom * friction;
_parent.top._rotation = _parent.top._rotation + playerspin;
_parent.bottom._rotation = _parent.bottom._rotation + playerspin;
} else if (resetframe == 100) {
_parent._visible = true;
_parent.play();
this.removeMovieClip();
}
Symbol 202 MovieClip [resetplayer] Frame 3
gotoAndPlay (2);
Symbol 209 Button
on (release) {
trace("playedgame is " + playedgame);
if (!_parent.playedgame) {
_parent.playedgame = true;
_parent.players = 0;
_parent.demonstration = true;
} else {
_parent.players = 2;
_parent.demonstration = false;
}
_parent.gameplayers = 2;
_parent.gotoAndPlay(5);
}
Symbol 210 MovieClip Frame 1
stop();
Symbol 211 Button
on (release) {
trace("playedgame is " + playedgame);
if (!_parent.playedgame) {
_parent.playedgame = true;
_parent.players = 0;
_parent.demonstration = true;
} else {
_parent.players = 1;
_parent.demonstration = false;
}
_parent.gameplayers = 1;
_parent.gotoAndPlay(5);
}
Symbol 212 MovieClip Frame 1
stop();
Symbol 220 MovieClip Frame 1
function setvolume() {
endgamesound.setVolume(_level0.globalvolume);
traffic1.setVolume(_level0.globalvolume);
traffic2.setVolume(_level0.globalvolume);
keyclick.setVolume(_level0.globalvolume);
correct.setVolume(_level0.globalvolume);
wrong.setVolume(_level0.globalvolume);
boing.setVolume(_level0.globalvolume);
cutlawn.setVolume(_level0.globalvolume);
penguin.setVolume(_level0.globalvolume);
}
loop = new Sound(this);
loop.attachSound("loop");
endgamesound = new Sound(this);
endgamesound.attachSound("endgamesound");
traffic1 = new Sound(this);
traffic1.attachSound("traffic1");
traffic2 = new Sound(this);
traffic2.attachSound("traffic2");
keyclick = new Sound(this);
keyclick.attachSound("keyclick");
correct = new Sound(this);
correct.attachSound("correct");
wrong = new Sound(this);
wrong.attachSound("wrong");
penguin = new Sound(this);
penguin.attachSound("penguin");
boing = new Sound(this);
boing.attachSound("boing");
splash = new Sound(this);
splash.attachSound("splash");
setvolume();
if (_level0.online == 1) {
players = _level0.players;
gameplayers = _level0.players;
trace("players is " + players);
demonstration = true;
if (playedonce) {
players = gameplayers;
demonstration = false;
} else {
demonstration = true;
players = 0;
}
gotoAndPlay (5);
} else {
stop();
}
Symbol 220 MovieClip Frame 5
function mod(num) {
if (num < 0) {
return(-num);
}
return(num);
}
function swapmom() {
xpart = xdiff / hdiff;
ypart = ydiff / hdiff;
p1mom = Math.sqrt((player1.xmom * player1.xmom) + (player1.ymom * player1.ymom));
p2mom = Math.sqrt((player2.xmom * player2.xmom) + (player2.ymom * player2.ymom));
player1.xmom = (-p2mom) * xpart;
player1.ymom = (-p2mom) * ypart;
player2.xmom = p1mom * xpart;
player2.ymom = p1mom * ypart;
player1._x = player1._x - (xdiff / 2);
player2._x = player2._x + (xdiff / 2);
player1._y = player1._y - (ydiff / 2);
player2._y = player2._y + (ydiff / 2);
penguin.start();
}
function gameover() {
stop();
player1.ai = false;
player2.ai = false;
player1.keysenabled = false;
player2.keysenabled = false;
this.attachMovie("gameovertimer", "gameovertimer", 9876);
}
function gameoverbox() {
player1.removeMovieClip();
player2.removeMovieClip();
loop.stop();
cutlawn.stop();
endgamesound.start();
this.attachMovie("gameoverbox", "mygameoverbox", 10020);
mygameoverbox.p1score = scoreboard.aimscore1;
mygameoverbox.p2score = scoreboard.aimscore2;
}
function nextsymbol() {
trace("nextsymbol called");
nosymbol = true;
aimx = player._x;
aimy = player._y;
createdelay = 20 + int(random(100));
}
function nextbadsymbol() {
createbaddelay = 20 + int(random(100));
}
function createsymbol() {
nosymbol = false;
currentsymbol++;
trace("creating symbol " + currentsymbol);
if (25 < currentsymbol) {
gameover();
} else {
this.attachMovie("symbol", "symbol" + currentsymbol, 1000 + currentsymbol);
randomx = 110 - random(220);
if (int(random(2)) == 1) {
randomy = -200;
} else {
randomy = 200;
}
randomaimy = 110 - random(220);
this["symbol" + currentsymbol]._x = randomx;
this["symbol" + currentsymbol]._y = randomy;
this["symbol" + currentsymbol].aimy = randomaimy;
aimx = randomx;
aimy = randomaimy;
trace((("current x and y is " + aimx) + " ") + aimy);
}
}
function addscore(pnum, score) {
if (pnum == 1) {
p1score = p1score + score;
}
if (pnum == 2) {
p2score = p2score + score;
}
}
this.attachMovie("player", "player1", 3000);
this.attachMovie("player", "player2", 3001);
player1.leftkeychar = _level0.p1leftkeychar;
player1.rightkeychar = _level0.p1rightkeychar;
player1.middlekeychar = _level0.p1middlekeychar;
player2.leftkeychar = _level0.p2leftkeychar;
player2.rightkeychar = _level0.p2rightkeychar;
player2.middlekeychar = _level0.p2middlekeychar;
currentsymbol = 1;
currentbadsymbol = 1;
_parent.definekeys._visible = false;
if (gameplayers < 2) {
_parent.p2buttons._visible = false;
}
function reset(numplayers) {
currentsymbol = 0;
scoreboard.reset();
player1._visible = true;
player2._visible = true;
player1.play();
player2.play();
player1.resetplayer.removeMovieClip();
player2.resetplayer.removeMovieClip();
trace("reset - players " + numplayers);
if (numplayers == 0) {
demonstration = true;
player1._x = -105;
player1._y = 0;
player1._rotation = 0;
player1.difficulty = 1;
player1.ai = true;
player1.demoframe = 2;
player2._x = 700;
player1.play();
player2.stop();
player1.keysenabled = false;
player2.keysenabled = false;
}
if (numplayers == 1) {
demonstration = false;
player1._x = -105;
player1._y = 0;
player1.resetrotation(0);
player1.xmom = 0;
player1.ymom = 0;
player2._x = 105;
player2._y = 0;
player2.resetrotation(180);
player1.ai = false;
player2.ai = true;
player1.demoframe = 0;
player2.demoframe = 0;
player2.difficulty = 0.8;
player1.stop();
player2.stop();
this.attachMovie("readygo", "readygo", 10005);
player1.keysenabled = true;
player2.keysenabled = false;
nextsymbol();
}
if (numplayers == 2) {
demonstration = false;
player1._x = -105;
player1._y = 0;
player1.resetrotation(0);
player1.xmom = 0;
player1.ymom = 0;
player2._x = 105;
player2._y = 0;
player2.resetrotation(180);
player1.ai = false;
player2.ai = false;
player1.demoframe = 0;
player2.demoframe = 0;
player2.difficulty = 0.7;
player1.stop();
player2.stop();
this.attachMovie("readygo", "readygo", 10005);
player1.keysenabled = true;
player2.keysenabled = true;
nextsymbol();
}
}
this.attachMovie("scoreboard", "scoreboard", 10002);
scoreboard._y = -105;
scoreboard._x = 5;
this.attachMovie("correctp1", "correctp1", 9980);
this.attachMovie("correctp2", "correctp2", 9981);
correctp1._xscale = 50;
correctp1._yscale = 50;
correctp2._xscale = 50;
correctp2._yscale = 50;
players = gameplayers;
this.attachMovie("demomovie", "demomovie", 9999);
reset(0);
Symbol 220 MovieClip Frame 6
xdiff = player2._x - player1._x;
ydiff = player2._y - player1._y;
hdiff = Math.sqrt((xdiff * xdiff) + (ydiff * ydiff));
if (hdiff < (player1.radius * 2)) {
if (-200 < player1._y) {
swapmom();
}
}
if (0 < createdelay) {
createdelay--;
if (createdelay == 0) {
createsymbol();
}
}
if (nosymbol) {
aimx = player1._x;
aimy = player1._y;
}
Symbol 220 MovieClip Frame 7
gotoAndPlay (6);
Symbol 221 Button
on (release) {
_parent.nextkey();
}
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut, releaseOutside) {
this.gotoAndStop(1);
}
Symbol 226 MovieClip Frame 1
stop();
Symbol 241 MovieClip Frame 1
stop();
function hitbutton() {
gotoAndPlay (5);
}
function demohitbutton() {
gotoAndPlay (16);
}
Symbol 241 MovieClip Frame 8
gotoAndStop (2);
Symbol 241 MovieClip Frame 10
letter = "";
Instance of Symbol 236 MovieClip in Symbol 241 MovieClip Frame 10
onClipEvent (keyDown) {
keychar = String.fromCharCode(Key.getCode());
if (((47 < Key.getCode()) and (Key.getCode() < 58)) or ((64 < Key.getCode()) and (Key.getCode() < 91))) {
_parent.letter = keychar;
}
trace("key pressed is " + keychar);
}
Symbol 241 MovieClip Frame 11
if (0 < length(letter)) {
if (_parent._parent._parent.keycheck(letter, _parent._parent.currentkey)) {
_parent._parent.nextkey();
gotoAndStop (2);
} else {
trace("key already used");
gotoAndPlay (10);
}
} else {
gotoAndPlay (10);
}
Symbol 241 MovieClip Frame 26
if (dontreset) {
stop();
} else {
gotoAndStop (2);
}
Symbol 246 MovieClip Frame 7
stop();
Symbol 260 MovieClip Frame 1
stop();
function hitbutton() {
gotoAndPlay (5);
}
function demohitbutton() {
gotoAndPlay (16);
}
Symbol 260 MovieClip Frame 8
gotoAndStop (2);
Symbol 260 MovieClip Frame 10
letter = "";
Instance of Symbol 256 MovieClip in Symbol 260 MovieClip Frame 10
onClipEvent (keyDown) {
keychar = String.fromCharCode(Key.getCode());
if (((47 < Key.getCode()) and (Key.getCode() < 58)) or ((64 < Key.getCode()) and (Key.getCode() < 91))) {
_parent.letter = keychar;
}
}
Symbol 260 MovieClip Frame 11
if (0 < length(letter)) {
if (_parent._parent._parent.keycheck(letter, _parent._parent.currentkey)) {
_parent._parent.nextkey();
gotoAndStop (2);
} else {
trace("key already used");
gotoAndPlay (10);
}
} else {
gotoAndPlay (10);
}
Symbol 260 MovieClip Frame 26
gotoAndStop (2);
Symbol 267 MovieClip Frame 1
stop();
function nextkey() {
keyoverlay._visible = true;
currentkey++;
if (currentkey == 1) {
definekeys._visible = false;
keyoverlay._x = -200.8;
keyoverlay._y = 73.1;
p1buttons.leftkey.gotoAndPlay(10);
}
if (currentkey == 2) {
_parent.p1leftkeychar = p1buttons.leftkey.letter;
keyoverlay._x = -164.8;
keyoverlay._y = 76.1;
p1buttons.middlekey.gotoAndPlay(10);
}
if (currentkey == 3) {
_parent.p1middlekeychar = p1buttons.middlekey.letter;
keyoverlay._x = -128.8;
keyoverlay._y = 78.1;
p1buttons.rightkey.gotoAndPlay(10);
}
if (currentkey == 4) {
_parent.p1rightkeychar = p1buttons.rightkey.letter;
keyoverlay._x = 38.2;
keyoverlay._y = 78.1;
p2buttons.leftkey.gotoAndPlay(10);
}
if (currentkey == 5) {
_parent.p2leftkeychar = p2buttons.leftkey.letter;
keyoverlay._x = 73.2;
keyoverlay._y = 76.1;
p2buttons.middlekey.gotoAndPlay(10);
}
if (currentkey == 6) {
_parent.p2middlekeychar = p2buttons.middlekey.letter;
keyoverlay._x = 111.2;
keyoverlay._y = 73.1;
p2buttons.rightkey.gotoAndPlay(10);
}
if (currentkey == 7) {
_parent.p2rightkeychar = p2buttons.rightkey.letter;
keyoverlay._visible = false;
definekeys._visible = true;
currentkey = 0;
}
}
currentkey = 0;
keyoverlay._visible = false;
if (_level0.online == 1) {
p1buttons._y = 138.9;
p2buttons._y = 139.9;
p1buttons._x = p1buttons._x + 23;
p2buttons._x = p2buttons._x - 23;
definekeys._visible = false;
if (_level0.players < 2) {
p2buttons._visible = false;
}
}
Symbol 275 MovieClip Frame 1
stop();
Instance of Symbol 269 MovieClip in Symbol 275 MovieClip Frame 1
onClipEvent (load) {
tkb = _root.getBytesTotal();
if (_root.getBytesLoaded() == _root.getBytesTotal()) {
_root.nextFrame();
}
}
onClipEvent (enterFrame) {
p = Math.round((_root.getBytesLoaded() / tkb) * 100);
_root.loader.percent = p + " %";
_root.loader.gotoAndStop(p);
if (p == 100) {
_root.nextFrame();
}
}
Symbol 277 Button
on (release) {
getURL ("http://www.aliveis.com");
gotoAndStop (1);
this.gotoAndStop(1);
}
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut, releaseOutside) {
this.gotoAndStop(1);
}
Symbol 282 MovieClip Frame 1
stop();