Frame 10
function CheckoutTable(number, bed) {
this.number = number;
this.bed = bed;
}
function ScoreTable(number, bed, angle1, angle2, radius1, radius2, toplevel) {
this.number = number;
this.bed = bed;
this.angle1 = angle1;
this.angle2 = angle2;
this.radius1 = radius1;
this.radius2 = radius2;
this.toplevel = toplevel;
}
function CalculateScore(x, y) {
var radius;
var angle;
var score;
var multiplier;
x = _root.movBoard._x - x;
y = _root.movBoard._y - y;
angle = 57.2957795130823 * Math.atan(Math.abs(x) / Math.abs(y));
radius = Math.sqrt((Math.abs(x) * Math.abs(x)) + (Math.abs(y) * Math.abs(y)));
if (y > 0) {
if (x < 0) {
if ((angle > 0) and (angle <= 9)) {
score = 20;
}
if ((angle > 9) and (angle <= 27)) {
score = 1;
}
if ((angle > 27) and (angle <= 45)) {
score = 18;
}
if ((angle > 45) and (angle <= 63)) {
score = 4;
}
if ((angle > 63) and (angle <= 81)) {
score = 13;
}
if ((angle > 81) and (angle <= 90)) {
score = 6;
}
} else if (x > 0) {
if ((angle > 0) and (angle <= 9)) {
score = 20;
}
if ((angle > 9) and (angle <= 27)) {
score = 5;
}
if ((angle > 27) and (angle <= 45)) {
score = 12;
}
if ((angle > 45) and (angle <= 63)) {
score = 9;
}
if ((angle > 63) and (angle <= 81)) {
score = 14;
}
if ((angle > 81) and (angle <= 90)) {
score = 11;
}
}
} else if (y < 0) {
if (x < 0) {
if ((angle > 0) and (angle <= 8)) {
score = 3;
}
if ((angle > 8) and (angle <= 27)) {
score = 17;
}
if ((angle > 27) and (angle <= 45)) {
score = 2;
}
if ((angle > 45) and (angle <= 63)) {
score = 15;
}
if ((angle > 63) and (angle <= 81)) {
score = 10;
}
if ((angle > 81) and (angle <= 90)) {
score = 6;
}
} else if (x > 0) {
if ((angle > 0) and (angle <= 8)) {
score = 3;
}
if ((angle > 8) and (angle <= 27)) {
score = 19;
}
if ((angle > 27) and (angle <= 45)) {
score = 7;
}
if ((angle > 45) and (angle <= 63)) {
score = 16;
}
if ((angle > 63) and (angle <= 81)) {
score = 8;
}
if ((angle > 81) and (angle <= 90)) {
score = 11;
}
}
}
multiplier = 1;
if ((radius >= 68) and (radius <= 74)) {
multiplier = 3;
} else if ((radius >= 110) and (radius <= 118)) {
multiplier = 2;
} else if (radius > 118) {
multiplier = 0;
} else if ((radius >= 0) and (radius <= 5)) {
multiplier = 1;
score = 50;
} else if ((radius > 5) and (radius <= 11)) {
multiplier = 1;
score = 25;
}
_root.LastRadius = radius;
score = score * multiplier;
return(score);
}
function myOnConnect(success) {
if (success) {
_root.comm.connected = true;
trace("Connected... " + _root.comm.username);
_root.comm.sock.send("L:" + _root.comm.username);
} else {
trace("Connection Failed!");
}
}
function myOnXML(doc) {
_root.trace(doc);
}
movScoreFlow.swapDepths(5000);
var PlayerName;
PlayerName = "Player 1";
var FastPlay;
Instance of Symbol 19 MovieClip "comm" in Frame 10
onClipEvent (load) {
var sock;
var username;
var connected;
sock = new XMLSocket();
sock.onXML = _root.myOnXML;
sock.onConnect = _root.myOnConnect;
connected = false;
username = "";
}
Frame 20
var ChosenPlayerSkill;
ChosenPlayerSkill = 20;
movTickBox._boxstatus = FastPlay;
var ThrowFirst;
var Legs_1;
var Legs_2;
txtCPUName = "Jim Boeing";
txtPlayer.text = PlayerName;
Legs_1 = 0;
Legs_2 = 0;
if ((Math.random() * 20) > 9) {
ThrowFirst = -1;
} else {
ThrowFirst = 1;
}
_root.objDart1._visible = false;
_root.objDart2._visible = false;
_root.objDart3._visible = false;
stop();
Instance of Symbol 69 MovieClip "movScoreFlow" in Frame 20
onClipEvent (load) {
counter = -200;
scale = 0;
alpha = 0;
_alpha = 0;
}
onClipEvent (enterFrame) {
counter++;
_width = ((_width + scale) + 20);
_height = (_height + scale);
_alpha = (_alpha + alpha);
if (counter < 0) {
_height = 35;
_width = 198;
counter = -201;
}
if (counter == 20) {
alpha = 6;
scale = 5;
}
if (counter == 40) {
scale = 2.5;
alpha = alpha * -1.5;
}
if (counter == 55) {
_width = 198;
_height = 35;
alpha = 0;
_alpha = 0;
counter = -200;
scale = 0;
}
}
Instance of Symbol 73 MovieClip "movTickBox" in Frame 20
onClipEvent (load) {
var _boxstatus;
if (_boxstatus == 1) {
this.gotoAndPlay("Tick");
}
}
Frame 30
if (_root.comm.connected == false) {
_root.comm.username = _root.txtP1Name;
_root.comm.sock.connect("172.182.69.93", "2001");
}
movScoreFlow.counter = 19;
movScoreFlow.scale = 0;
movScoreFlow.txtScoreFlow = "Game On!";
if (_root.comm.connected == true) {
_root.comm.sock.send("O:" + _root.comm.username);
}
trace("FASTPLAY : " + FastPlay);
var RemainingScore_1;
var RemainingScore_2;
var Darts_1;
var Darts_2;
var CPUSpeed;
var AddDarts;
var GameOver;
_root.txtP1Name = PlayerName;
RemainingScore_1 = 501;
RemainingScore_2 = 501;
Darts_1 = 0;
Darts_2 = 0;
if (FastPlay == 1) {
CPUSpeed = 10;
} else {
CPUSpeed = 50;
}
trace("CPUSpeed : " + CPUSpeed);
GameOver = false;
_root.txtCPULegs = "Legs: " + Legs_2;
_root.txtP1Legs = "Legs: " + Legs_1;
trace("LEGS_1 : " + Legs_1);
trace("LEGS_2 : " + Legs_2);
var ComputerSkill;
var ComputerRadius;
var ComputerAngle;
ComputerSkill = ChosenPlayerSkill;
trace("PLAYER SKILL CHOSEN : " + ChosenPlayerSkill);
var CheckoutTable2 = new Array();
var CheckoutTable3 = new Array();
var ScoreTable1 = new Array();
CheckoutTable2[0] = new CheckoutTable(110, "T20");
CheckoutTable2[1] = new CheckoutTable(107, "T19");
CheckoutTable2[2] = new CheckoutTable(104, "T18");
CheckoutTable2[3] = new CheckoutTable(101, "T17");
CheckoutTable2[4] = new CheckoutTable(98, "T20");
CheckoutTable2[5] = new CheckoutTable(97, "T19");
CheckoutTable2[6] = new CheckoutTable(96, "T20");
CheckoutTable2[7] = new CheckoutTable(95, "T19");
CheckoutTable2[8] = new CheckoutTable(94, "T18");
CheckoutTable2[9] = new CheckoutTable(93, "T19");
CheckoutTable2[10] = new CheckoutTable(92, "T20");
CheckoutTable2[11] = new CheckoutTable(91, "T17");
CheckoutTable2[12] = new CheckoutTable(90, "T18");
CheckoutTable2[13] = new CheckoutTable(89, "T19");
CheckoutTable2[14] = new CheckoutTable(88, "T16");
CheckoutTable2[15] = new CheckoutTable(87, "T17");
CheckoutTable2[16] = new CheckoutTable(86, "T18");
CheckoutTable2[17] = new CheckoutTable(85, "T15");
CheckoutTable2[18] = new CheckoutTable(84, "T18");
CheckoutTable2[19] = new CheckoutTable(83, "T17");
CheckoutTable2[20] = new CheckoutTable(82, "T14");
CheckoutTable2[21] = new CheckoutTable(81, "T15");
CheckoutTable2[22] = new CheckoutTable(80, "T16");
CheckoutTable2[23] = new CheckoutTable(79, "T13");
CheckoutTable2[24] = new CheckoutTable(78, "T18");
CheckoutTable2[25] = new CheckoutTable(77, "T15");
CheckoutTable2[26] = new CheckoutTable(76, "T20");
CheckoutTable2[27] = new CheckoutTable(75, "T13");
CheckoutTable2[28] = new CheckoutTable(74, "T14");
CheckoutTable2[29] = new CheckoutTable(73, "T19");
CheckoutTable2[30] = new CheckoutTable(72, "T12");
CheckoutTable2[31] = new CheckoutTable(71, "T13");
CheckoutTable2[32] = new CheckoutTable(70, "T18");
CheckoutTable2[33] = new CheckoutTable(69, "S19");
CheckoutTable2[34] = new CheckoutTable(68, "T20");
CheckoutTable2[35] = new CheckoutTable(67, "T17");
CheckoutTable2[36] = new CheckoutTable(66, "T10");
CheckoutTable2[37] = new CheckoutTable(65, "S25");
CheckoutTable2[38] = new CheckoutTable(64, "T16");
CheckoutTable2[39] = new CheckoutTable(63, "T13");
CheckoutTable2[40] = new CheckoutTable(62, "T10");
CheckoutTable2[41] = new CheckoutTable(61, "S25");
CheckoutTable2[42] = new CheckoutTable(60, "S20");
CheckoutTable2[43] = new CheckoutTable(59, "T19");
CheckoutTable2[44] = new CheckoutTable(58, "S18");
CheckoutTable2[45] = new CheckoutTable(57, "S17");
CheckoutTable2[46] = new CheckoutTable(56, "S16");
CheckoutTable2[47] = new CheckoutTable(55, "S15");
CheckoutTable2[48] = new CheckoutTable(54, "S14");
CheckoutTable2[49] = new CheckoutTable(53, "S13");
CheckoutTable2[50] = new CheckoutTable(52, "S12");
CheckoutTable2[51] = new CheckoutTable(51, "S19");
CheckoutTable2[52] = new CheckoutTable(50, "S10");
CheckoutTable2[53] = new CheckoutTable(49, "S17");
CheckoutTable2[54] = new CheckoutTable(48, "S16");
CheckoutTable2[55] = new CheckoutTable(47, "S15");
CheckoutTable2[56] = new CheckoutTable(46, "S6");
CheckoutTable2[57] = new CheckoutTable(45, "S13");
CheckoutTable2[58] = new CheckoutTable(44, "S12");
CheckoutTable2[59] = new CheckoutTable(43, "S3");
CheckoutTable2[60] = new CheckoutTable(42, "S10");
CheckoutTable2[61] = new CheckoutTable(41, "S9");
CheckoutTable3[0] = new CheckoutTable(170, "T20");
CheckoutTable3[1] = new CheckoutTable(167, "T20");
CheckoutTable3[2] = new CheckoutTable(164, "T19");
CheckoutTable3[3] = new CheckoutTable(161, "T20");
CheckoutTable3[4] = new CheckoutTable(160, "T20");
CheckoutTable3[5] = new CheckoutTable(158, "T20");
CheckoutTable3[6] = new CheckoutTable(157, "T19");
CheckoutTable3[7] = new CheckoutTable(156, "T20");
CheckoutTable3[8] = new CheckoutTable(155, "T20");
CheckoutTable3[9] = new CheckoutTable(154, "T20");
CheckoutTable3[10] = new CheckoutTable(153, "T20");
CheckoutTable3[11] = new CheckoutTable(152, "T20");
CheckoutTable3[12] = new CheckoutTable(151, "T20");
CheckoutTable3[13] = new CheckoutTable(150, "T20");
CheckoutTable3[14] = new CheckoutTable(149, "T20");
CheckoutTable3[15] = new CheckoutTable(148, "T20");
CheckoutTable3[16] = new CheckoutTable(147, "T20");
CheckoutTable3[17] = new CheckoutTable(146, "T20");
CheckoutTable3[18] = new CheckoutTable(145, "T20");
CheckoutTable3[19] = new CheckoutTable(144, "T20");
CheckoutTable3[20] = new CheckoutTable(143, "T20");
CheckoutTable3[21] = new CheckoutTable(142, "T20");
CheckoutTable3[22] = new CheckoutTable(141, "T20");
CheckoutTable3[23] = new CheckoutTable(140, "T20");
CheckoutTable3[24] = new CheckoutTable(139, "T20");
CheckoutTable3[25] = new CheckoutTable(138, "T20");
CheckoutTable3[26] = new CheckoutTable(137, "T20");
CheckoutTable3[27] = new CheckoutTable(136, "T20");
CheckoutTable3[28] = new CheckoutTable(135, "T20");
CheckoutTable3[29] = new CheckoutTable(134, "T20");
CheckoutTable3[30] = new CheckoutTable(133, "T20");
CheckoutTable3[31] = new CheckoutTable(132, "T20");
CheckoutTable3[32] = new CheckoutTable(131, "T20");
CheckoutTable3[33] = new CheckoutTable(130, "T20");
CheckoutTable3[34] = new CheckoutTable(129, "T19");
CheckoutTable3[35] = new CheckoutTable(128, "T20");
CheckoutTable3[36] = new CheckoutTable(127, "T20");
CheckoutTable3[37] = new CheckoutTable(126, "T19");
CheckoutTable3[38] = new CheckoutTable(125, "T20");
CheckoutTable3[39] = new CheckoutTable(124, "T20");
CheckoutTable3[40] = new CheckoutTable(123, "T20");
CheckoutTable3[41] = new CheckoutTable(122, "T18");
CheckoutTable3[42] = new CheckoutTable(121, "S25");
CheckoutTable3[43] = new CheckoutTable(120, "T20");
CheckoutTable3[44] = new CheckoutTable(119, "T19");
CheckoutTable3[45] = new CheckoutTable(118, "T20");
CheckoutTable3[46] = new CheckoutTable(117, "T20");
CheckoutTable3[47] = new CheckoutTable(116, "T20");
CheckoutTable3[48] = new CheckoutTable(115, "T19");
CheckoutTable3[49] = new CheckoutTable(114, "T20");
CheckoutTable3[50] = new CheckoutTable(113, "T20");
CheckoutTable3[51] = new CheckoutTable(112, "T20");
CheckoutTable3[52] = new CheckoutTable(111, "T20");
CheckoutTable3[53] = new CheckoutTable(110, "T20");
CheckoutTable3[54] = new CheckoutTable(109, "T20");
CheckoutTable3[55] = new CheckoutTable(108, "T19");
CheckoutTable3[56] = new CheckoutTable(107, "T19");
CheckoutTable3[57] = new CheckoutTable(106, "T20");
CheckoutTable3[58] = new CheckoutTable(105, "T20");
CheckoutTable3[59] = new CheckoutTable(104, "T20");
CheckoutTable3[60] = new CheckoutTable(103, "T19");
CheckoutTable3[61] = new CheckoutTable(102, "T20");
CheckoutTable3[62] = new CheckoutTable(101, "T17");
CheckoutTable3[63] = new CheckoutTable(99, "T19");
ScoreTable1[0] = new ScoreTable(0, "S0", 0, 0, 0, 0, 0);
ScoreTable1[1] = new ScoreTable(1, "S1", 9, 27, 74, 110, 1);
ScoreTable1[2] = new ScoreTable(2, "S2", 27, 45, 74, 110, 2);
ScoreTable1[3] = new ScoreTable(2, "D1", 9, 27, 110, 118, 1);
ScoreTable1[4] = new ScoreTable(3, "S3", 0, 9, 74, 110, 3);
ScoreTable1[5] = new ScoreTable(4, "S4", 45, 63, 74, 110, 4);
ScoreTable1[6] = new ScoreTable(4, "D2", 27, 45, 110, 118, 2);
ScoreTable1[7] = new ScoreTable(5, "S5", 9, 27, 74, 110, 5);
ScoreTable1[8] = new ScoreTable(6, "S6", 81, 90, 74, 110, 6);
ScoreTable1[9] = new ScoreTable(6, "D3", 0, 9, 110, 118, 3);
ScoreTable1[10] = new ScoreTable(7, "S7", 27, 45, 74, 110, 7);
ScoreTable1[11] = new ScoreTable(8, "S8", 63, 81, 74, 110, 8);
ScoreTable1[12] = new ScoreTable(8, "D4", 45, 63, 110, 118, 4);
ScoreTable1[13] = new ScoreTable(9, "S9", 45, 63, 74, 110, 9);
ScoreTable1[14] = new ScoreTable(10, "S10", 63, 81, 110, 10);
ScoreTable1[15] = new ScoreTable(10, "D5", 9, 27, 110, 118, 5);
ScoreTable1[16] = new ScoreTable(11, "S11", 81, 90, 74, 110, 11);
ScoreTable1[17] = new ScoreTable(12, "S12", 27, 45, 74, 110, 12);
ScoreTable1[18] = new ScoreTable(12, "D6", 81, 90, 110, 118, 6);
ScoreTable1[19] = new ScoreTable(13, "S13", 63, 81, 74, 110, 13);
ScoreTable1[20] = new ScoreTable(14, "S14", 63, 81, 74, 110, 14);
ScoreTable1[21] = new ScoreTable(14, "D7", 27, 45, 110, 118, 7);
ScoreTable1[22] = new ScoreTable(15, "S15", 45, 63, 74, 110, 15);
ScoreTable1[23] = new ScoreTable(16, "S16", 45, 63, 74, 110, 16);
ScoreTable1[24] = new ScoreTable(16, "D8", 63, 81, 110, 118, 8);
ScoreTable1[25] = new ScoreTable(17, "S17", 9, 27, 74, 110, 17);
ScoreTable1[26] = new ScoreTable(18, "S18", 27, 45, 74, 110, 18);
ScoreTable1[27] = new ScoreTable(18, "D9", 45, 63, 110, 118, 9);
ScoreTable1[28] = new ScoreTable(19, "S19", 9, 27, 74, 110, 19);
ScoreTable1[29] = new ScoreTable(20, "S20", 0, 9, 74, 110, 20);
ScoreTable1[30] = new ScoreTable(20, "D10", 63, 81, 110, 118, 10);
ScoreTable1[31] = new ScoreTable(22, "D11", 81, 90, 110, 118, 11);
ScoreTable1[32] = new ScoreTable(24, "D12", 27, 45, 110, 118, 12);
ScoreTable1[33] = new ScoreTable(26, "D13", 63, 81, 110, 118, 13);
ScoreTable1[34] = new ScoreTable(28, "D14", 63, 81, 110, 118, 14);
ScoreTable1[35] = new ScoreTable(30, "D15", 45, 63, 110, 118, 15);
ScoreTable1[36] = new ScoreTable(32, "D16", 45, 63, 110, 118, 16);
ScoreTable1[37] = new ScoreTable(34, "D17", 9, 27, 110, 118, 17);
ScoreTable1[38] = new ScoreTable(36, "D18", 27, 45, 110, 118, 18);
ScoreTable1[39] = new ScoreTable(38, "D19", 9, 27, 110, 118, 19);
ScoreTable1[40] = new ScoreTable(40, "D20", 0, 9, 110, 118, 20);
ScoreTable1[41] = new ScoreTable(3, "T1", 9, 27, 68, 74, 1);
ScoreTable1[42] = new ScoreTable(6, "T2", 27, 45, 68, 74, 2);
ScoreTable1[43] = new ScoreTable(9, "T3", 0, 9, 68, 74, 3);
ScoreTable1[44] = new ScoreTable(12, "T4", 45, 63, 68, 74, 4);
ScoreTable1[45] = new ScoreTable(15, "T5", 9, 27, 68, 74, 5);
ScoreTable1[46] = new ScoreTable(18, "T6", 81, 90, 68, 74, 6);
ScoreTable1[47] = new ScoreTable(21, "T7", 27, 45, 68, 74, 7);
ScoreTable1[48] = new ScoreTable(24, "T8", 63, 81, 68, 74, 8);
ScoreTable1[49] = new ScoreTable(27, "T9", 45, 63, 68, 74, 9);
ScoreTable1[50] = new ScoreTable(30, "T10", 63, 81, 68, 74, 10);
ScoreTable1[51] = new ScoreTable(33, "T11", 81, 90, 68, 74, 11);
ScoreTable1[52] = new ScoreTable(36, "T12", 27, 45, 68, 74, 12);
ScoreTable1[53] = new ScoreTable(39, "T13", 63, 81, 68, 74, 13);
ScoreTable1[54] = new ScoreTable(42, "T14", 63, 81, 68, 74, 14);
ScoreTable1[55] = new ScoreTable(45, "T15", 45, 63, 68, 74, 15);
ScoreTable1[56] = new ScoreTable(48, "T16", 45, 63, 68, 74, 16);
ScoreTable1[57] = new ScoreTable(51, "T17", 9, 27, 68, 74, 17);
ScoreTable1[58] = new ScoreTable(54, "T18", 27, 45, 68, 74, 18);
ScoreTable1[59] = new ScoreTable(57, "T19", 9, 27, 68, 74, 19);
ScoreTable1[60] = new ScoreTable(60, "T20", 0, 9, 68, 74, 20);
ScoreTable1[61] = new ScoreTable(25, "S25", 0, 90, 5, 11, 25);
ScoreTable1[62] = new ScoreTable(50, "S50", 0, 90, 0, 5, 50);
n = 3;
while (n < 73) {
setProperty("strike2_" + n, _alpha , 0);
setProperty("strike1_" + n, _alpha , 0);
n = n + 3;
}
stop();
if (ThrowFirst == -1) {
gotoAndPlay (40);
} else {
gotoAndPlay (80);
}
Frame 40
var runningTotal_1;
var LastRadius;
AddDarts = 2;
if (_root.comm.connected == false) {
_root.comm.username = _root.txtP1Name;
_root.comm.sock.connect("172.182.69.93", "2001");
}
_root.objDarta.stop();
removeMovieClip(objDart1);
removeMovieClip(objDart2);
removeMovieClip(objDart3);
_root.objSliders.objSliderTop.slide = 1;
_root.objSliders.objSliderRight.slide = 0;
runningTotal_1 = 0;
stop();
Instance of Symbol 124 MovieClip "objDarta" in Frame 40
onClipEvent (load) {
counter = 23;
dscale = 300;
}
onClipEvent (enterFrame) {
counter--;
if (counter >= 0) {
dscale = dscale * 0.92;
_xscale = dscale;
_yscale = dscale;
}
}
Frame 50
if (_root.comm.connected == true) {
_root.comm.sock.send("O:" + _root.comm.username);
}
AddDarts = 1;
stop();
Instance of Symbol 124 MovieClip "objDartb" in Frame 50
onClipEvent (load) {
counter = 23;
dscale = 300;
}
onClipEvent (enterFrame) {
counter--;
if (counter >= 0) {
dscale = dscale * 0.92;
_xscale = dscale;
_yscale = dscale;
}
if (counter == 3) {
}
}
Frame 60
_root.txtScores.text = "Current Score: " + RunningTotal_1;
AddDarts = 0;
stop();
Instance of Symbol 124 MovieClip "objDartc" in Frame 60
onClipEvent (load) {
counter = 23;
dscale = 300;
}
onClipEvent (enterFrame) {
counter--;
if (counter >= 0) {
dscale = dscale * 0.92;
_xscale = dscale;
_yscale = dscale;
}
if (counter == 3) {
}
}
Frame 70
_root.txtScores.text = "";
Darts_1 = Darts_1 + AddDarts;
trace("PLAYER 1 DARTS USED : " + Darts_1);
if (((RemainingScore_1 - runningTotal_1) == 0) and (_root.Lastradius < 110)) {
if (_root.LastRadius < 10) {
movScoreFlow.counter = 0;
movScoreFlow.scale = 0;
movScoreFlow.txtScoreFlow = "Game Shot!";
GameOver = true;
_root.objSliders.objSliderTop.slide = 0;
_root.objSliders.objSliderRight.slide = 0;
_root.objSliders.objSliderTop.slide = 0;
_root.objSliders.objSliderRight.slide = 0;
} else {
_root.movScoreFlow.counter = 0;
_root.movScoreFlow.scale = 0;
_root.movScoreFlow.txtScoreFlow = "No Score!";
_root.objSliders.objSliderTop.slide = 0;
_root.objSliders.objSliderRight.slide = 0;
}
} else if ((RemainingScore_1 - runningTotal_1) <= 1) {
if ((_root.lastradius >= 110) and ((RemainingScore_1 - runningTotal_1) == 0)) {
if (_root.Lastradius <= 118) {
movScoreFlow.counter = 0;
movScoreFlow.scale = 0;
movScoreFlow.txtScoreFlow = "Game Shot!";
GameOver = true;
_root.objSliders.objSliderTop.slide = 0;
_root.objSliders.objSliderRight.slide = 0;
}
} else if ((remainingScore_1 - runningTotal_1) <= 1) {
movScoreFlow.counter = 0;
movScoreFlow.scale = 0;
movScoreFlow.txtScoreFlow = "No Score!";
_root.objSliders.objSliderTop.slide = 0;
_root.objSliders.objSliderRight.slide = 0;
}
} else {
RemainingScore_1 = RemainingScore_1 - runningTotal_1;
movScoreFlow.counter = 0;
movScoreFlow.scale = 0;
movScoreFlow.txtScoreFlow = runningTotal_1;
}
setProperty("strike2_" + _root.Darts_1, _alpha , 100);
stop();
Instance of Symbol 133 MovieClip "Timer1" in Frame 70
onClipEvent (load) {
counter = 0;
}
onClipEvent (enterFrame) {
counter++;
if (counter == 26) {
_root.txtStatusDisplay = _root.txtStatus;
}
if (counter == 55) {
if (_root.Darts_1 > 33) {
if (_root.Darts_1 > 36) {
_root.txtP1Score_2 = _root.txtP1Score_2 + (newline + _root.RemainingScore_1);
} else {
_root.txtP1Score_2 = _root.RemainingScore_1;
}
} else {
_root.txtP1Score_1 = _root.txtP1Score_1 + (newline + _root.RemainingScore_1);
}
if (_root.GameOver == false) {
_root.gotoAndStop("Comp 1");
} else {
_root.Legs_1 = _root.Legs_1 + 1;
_root.gotoAndStop("End");
}
}
}
Frame 80
AddDarts = 2;
_root.txtScores.text = "";
_root.objSliders.objSliderTop.slide = 0;
_root.objSliders.objSliderRight.slide = 0;
_root.objDart1._visible = false;
_root.objDart2._visible = false;
_root.objDart3._visible = false;
_root.objDarta.stop();
var runningTotal_2;
var LastRadius;
runningTotal_2 = 0;
var n;
var i;
var randNumber;
var ChosenShotID;
var Required;
var Shot_x;
var Shot_y;
ChosenShotID = 9999;
trace("REMAINING SCORE : " + RemainingScore_2);
if (((RemainingScore_2 < 41) && ((RemainingScore_2 % 2) == 0)) && (RemainingScore_2 > 1)) {
trace("LOOKING FOR DOUBLE TO THROW");
n = 0;
while (n < ScoreTable1.length) {
if ((ScoreTable1[n].number == RemainingScore_2) && (ScoreTable1[n].bed.indexOf("D", 0) != -1)) {
trace("POSSIBLE THROW : " + ScoreTable1[n].bed);
if (ChosenShotID == 9999) {
ChosenShotID = n;
}
}
n++;
}
}
if (((RemainingScore_2 < 41) && ((RemainingScore_2 % 2) == 1)) && (RemainingScore_2 > 1)) {
trace("LOOKING TO LEAVE DOUBLE ON NEXT THROW");
if (RemainingScore_2 > 32) {
Required = RemainingScore_2 - 32;
}
if ((RemainingScore_2 > 16) && (RemainingScore_2 < 32)) {
Required = RemainingScore_2 - 16;
}
if ((RemainingScore_2 > 8) && (RemainingScore_2 < 16)) {
Required = RemainingScore_2 - 8;
}
if ((RemainingScore_2 > 4) && (RemainingScore_2 < 8)) {
Required = RemainingScore_2 - 4;
}
if ((RemainingScore_2 > 2) && (RemainingScore_2 < 4)) {
Required = RemainingScore_2 - 2;
}
trace("REQUIRED TO LEAVE DOUBLE : " + Required);
n = 0;
while (n < ScoreTable1.length) {
if (ScoreTable1[n].number == Required) {
trace("POSSIBLE THROW : " + ScoreTable1[n].bed);
if (ChosenShotID == 9999) {
ChosenShotID = n;
}
}
n++;
}
}
i = 0;
while (i < CheckoutTable2.length) {
if (CheckoutTable2[i].number == RemainingScore_2) {
trace("LOOKING FOR 2 DART CHECKOUT");
n = 0;
while (n < ScoreTable1.length) {
if (ScoreTable1[n].bed == CheckoutTable2[i].bed) {
trace("POSSIBLE THROW : " + ScoreTable1[n].bed);
if (ChosenShotID == 9999) {
ChosenShotID = n;
}
}
n++;
}
}
i++;
}
i = 0;
while (i < CheckoutTable3.length) {
if (CheckoutTable3[i].number == RemainingScore_2) {
trace("LOOKING FOR 3 DART CHECKOUT");
n = 0;
while (n < ScoreTable1.length) {
if (ScoreTable1[n].bed == CheckoutTable3[i].bed) {
trace("POSSIBLE THROW : " + ScoreTable1[n].bed);
if (ChosenShotID == 9999) {
ChosenShotID = n;
}
}
n++;
}
}
i++;
}
if (((RemainingScore_2 % 2) == 0) || ((((((RemainingScore_2 == 501) || (RemainingScore_2 == 441)) || (RemainingScore_2 == 381)) || (RemainingScore_2 == 321)) || (RemainingScore_2 == 261)) || (RemainingScore_2 == 201))) {
trace("LOOKING FOR 9 DART GAME");
n = 0;
while (n < ScoreTable1.length) {
if (ScoreTable1[n].number == 60) {
trace("POSSIBLE THROW : " + ScoreTable1[n].bed);
if (ChosenShotID == 9999) {
ChosenShotID = n;
}
}
n++;
}
}
if ((RemainingScore_2 % 2) == 1) {
trace("LOOKING FOR STANDARD THROW");
randNumber = Math.random() * 20;
if (randNumber < 14) {
n = 0;
while (n < ScoreTable1.length) {
if (ScoreTable1[n].number == 60) {
trace("POSSIBLE THROW : " + ScoreTable1[n].bed);
if (ChosenShotID == 9999) {
ChosenShotID = n;
}
}
n++;
}
}
if ((randNumber >= 14) && (randNumber < 17)) {
n = 0;
while (n < ScoreTable1.length) {
if (ScoreTable1[n].number == 57) {
trace("POSSIBLE THROW : " + ScoreTable1[n].bed);
if (ChosenShotID == 9999) {
ChosenShotID = n;
}
}
n++;
}
}
if (randNumber >= 17) {
n = 0;
while (n < ScoreTable1.length) {
if (ScoreTable1[n].number == 51) {
trace("POSSIBLE THROW : " + ScoreTable1[n].bed);
if (ChosenShotID == 9999) {
ChosenShotID = n;
}
}
n++;
}
}
}
trace("FINAL SHOT CHOSEN (DART 1): " + ScoreTable1[ChosenShotID].bed);
randNumber = math.random() * ((ScoreTable1[ChosenShotID].radius2 - ScoreTable1[ChosenShotID].radius1) + ComputerSkill);
ComputerRadius = randNumber + (ScoreTable1[ChosenShotID].radius1 - (ComputerSkill / 2));
trace("RADIUS OF SHOT : " + ComputerRadius);
randNumber = math.random() * ((ScoreTable1[ChosenShotID].angle2 - ScoreTable1[ChosenShotID].angle1) + ComputerSkill);
ComputerAngle = randNumber + (ScoreTable1[ChosenShotID].angle1 - (ComputerSkill / 2));
trace("ANGLE OF SHOT : " + ComputerAngle);
TEMPradian = (Math.PI/180) * ComputerAngle;
randNumber = Math.random() * 20;
if (randNumber > 9) {
TEMPsign_x = 1;
} else {
TEMPsign_x = -1;
}
randNumber = Math.random() * 20;
if (randNumber > 9) {
TEMPsign_y = 1;
} else {
TEMPsign_y = -1;
}
if (ScoreTable1[ChosenShotID].toplevel == 20) {
TEMPsign_y = -1;
}
if (ScoreTable1[ChosenShotID].toplevel == 3) {
TEMPsign_y = 1;
}
if (ScoreTable1[ChosenShotID].toplevel == 6) {
TEMPsign_x = 1;
}
if (ScoreTable1[ChosenShotID].toplevel == 11) {
TEMPsign_x = -1;
}
if ((((ScoreTable1[ChosenShotID].toplevel == 1) || (ScoreTable1[ChosenShotID].toplevel == 18)) || (ScoreTable1[ChosenShotID].toplevel == 4)) || (ScoreTable1[ChosenShotID].toplevel == 13)) {
TEMPsign_x = 1;
TEMPsign_y = -1;
}
if ((((ScoreTable1[ChosenShotID].toplevel == 5) || (ScoreTable1[ChosenShotID].toplevel == 12)) || (ScoreTable1[ChosenShotID].toplevel == 9)) || (ScoreTable1[ChosenShotID].toplevel == 14)) {
TEMPsign_x = -1;
TEMPsign_y = -1;
}
if ((((ScoreTable1[ChosenShotID].toplevel == 8) || (ScoreTable1[ChosenShotID].toplevel == 16)) || (ScoreTable1[ChosenShotID].toplevel == 7)) || (ScoreTable1[ChosenShotID].toplevel == 19)) {
TEMPsign_x = -1;
TEMPsign_y = 1;
}
if ((((ScoreTable1[ChosenShotID].toplevel == 10) || (ScoreTable1[ChosenShotID].toplevel == 15)) || (ScoreTable1[ChosenShotID].toplevel == 2)) || (ScoreTable1[ChosenShotID].toplevel == 17)) {
TEMPsign_x = 1;
TEMPsign_y = 1;
}
shot_x = (ComputerRadius * Math.sin(TEMPradian)) * TEMPsign_x;
trace("X COORD : " + shot_x);
shot_y = (ComputerRadius * Math.cos(TEMPradian)) * TEMPsign_y;
trace("Y COORD : " + shot_y);
_root.objCross._x = _root.movBoard._x + shot_x;
_root.objCross._y = _root.movBoard._y + shot_y;
duplicateMovieClip (_root.objDarta, "objDart1", 1001);
_root.objDart1._x = _root.movBoard._x + shot_x;
_root.objDart1._y = _root.movBoard._y + shot_y;
_root.runningTotal_2 = _root.runningTotal_2 + _root.CalculateScore(_root.objDart1._x, _root.objDart1._y);
Darts_2++;
if ((RemainingScore_2 - runningTotal_2) <= 1) {
gotoAndPlay (141);
} else {
gotoAndPlay (90);
}
Instance of Symbol 124 MovieClip "objDarta" in Frame 80
onClipEvent (load) {
counter = 23;
dscale = 300;
}
onClipEvent (enterFrame) {
counter--;
if (counter >= 0) {
dscale = dscale * 0.92;
_xscale = dscale;
_yscale = dscale;
}
}
Frame 90
_root.txtScores.text = "Current Score: " + RunningTotal_2;
stop();
Instance of Symbol 133 MovieClip "Timer1" in Frame 90
onClipEvent (load) {
counter = 0;
}
onClipEvent (enterFrame) {
counter++;
if (counter > _root.CPUSpeed) {
if ((math.random() * 20) > 18) {
_root.gotoAndStop("Comp 2");
}
}
}
Frame 101
var n;
var i;
var randNumber;
var ChosenShotID;
var Required;
var Shot_x;
var Shot_y;
AddDarts = 1;
ChosenShotID = 9999;
trace("REMAINING SCORE : " + (RemainingScore_2 - runningTotal_2));
if ((((RemainingScore_2 - runningTotal_2) < 41) && (((RemainingScore_2 - runningTotal_2) % 2) == 0)) && ((RemainingScore_2 - runningTotal_2) > 1)) {
trace("LOOKING FOR DOUBLE TO THROW");
n = 0;
while (n < ScoreTable1.length) {
if ((ScoreTable1[n].number == (RemainingScore_2 - runningTotal_2)) && (ScoreTable1[n].bed.indexOf("D", 0) != -1)) {
trace("POSSIBLE THROW : " + ScoreTable1[n].bed);
if (ChosenShotID == 9999) {
ChosenShotID = n;
}
}
n++;
}
}
if ((((RemainingScore_2 - runningTotal_2) < 41) && (((RemainingScore_2 - runningTotal_2) % 2) == 1)) && ((RemainingScore_2 - runningTotal_2) > 1)) {
trace("LOOKING TO LEAVE DOUBLE ON NEXT THROW");
if ((RemainingScore_2 - runningTotal_2) > 32) {
Required = (RemainingScore_2 - runningTotal_2) - 32;
}
if (((RemainingScore_2 - runningTotal_2) > 16) && ((RemainingScore_2 - runningTotal_2) < 32)) {
Required = (RemainingScore_2 - runningTotal_2) - 16;
}
if (((RemainingScore_2 - runningTotal_2) > 8) && ((RemainingScore_2 - runningTotal_2) < 16)) {
Required = (RemainingScore_2 - runningTotal_2) - 8;
}
if (((RemainingScore_2 - runningTotal_2) > 4) && ((RemainingScore_2 - runningTotal_2) < 8)) {
Required = (RemainingScore_2 - runningTotal_2) - 4;
}
if (((RemainingScore_2 - runningTotal_2) > 2) && ((RemainingScore_2 - runningTotal_2) < 4)) {
Required = (RemainingScore_2 - runningTotal_2) - 2;
}
trace("REQUIRED TO LEAVE DOUBLE : " + Required);
n = 0;
while (n < ScoreTable1.length) {
if (ScoreTable1[n].number == Required) {
trace("POSSIBLE THROW : " + ScoreTable1[n].bed);
if (ChosenShotID == 9999) {
ChosenShotID = n;
}
}
n++;
}
}
i = 0;
while (i < CheckoutTable2.length) {
if (CheckoutTable2[i].number == (RemainingScore_2 - runningTotal_2)) {
trace("LOOKING FOR 2 DART CHECKOUT");
n = 0;
while (n < ScoreTable1.length) {
if (ScoreTable1[n].bed == CheckoutTable2[i].bed) {
trace("POSSIBLE THROW : " + ScoreTable1[n].bed);
if (ChosenShotID == 9999) {
ChosenShotID = n;
}
}
n++;
}
}
i++;
}
i = 0;
while (i < CheckoutTable3.length) {
if (CheckoutTable3[i].number == (RemainingScore_2 - runningTotal_2)) {
trace("LOOKING FOR 3 DART CHECKOUT");
n = 0;
while (n < ScoreTable1.length) {
if (ScoreTable1[n].bed == CheckoutTable3[i].bed) {
trace("POSSIBLE THROW : " + ScoreTable1[n].bed);
if (ChosenShotID == 9999) {
ChosenShotID = n;
}
}
n++;
}
}
i++;
}
if ((((RemainingScore_2 - runningTotal_2) % 2) == 0) || (((((((RemainingScore_2 - runningTotal_2) == 501) || ((RemainingScore_2 - runningTotal_2) == 441)) || ((RemainingScore_2 - runningTotal_2) == 381)) || ((RemainingScore_2 - runningTotal_2) == 321)) || ((RemainingScore_2 - runningTotal_2) == 261)) || ((RemainingScore_2 - runningTotal_2) == 201))) {
trace("LOOKING FOR 9 DART GAME");
n = 0;
while (n < ScoreTable1.length) {
if (ScoreTable1[n].number == 60) {
trace("POSSIBLE THROW : " + ScoreTable1[n].bed);
if (ChosenShotID == 9999) {
ChosenShotID = n;
}
}
n++;
}
}
if (((RemainingScore_2 - runningTotal_2) % 2) == 1) {
trace("LOOKING FOR STANDARD THROW");
randNumber = Math.random() * 20;
if (randNumber < 14) {
n = 0;
while (n < ScoreTable1.length) {
if (ScoreTable1[n].number == 60) {
trace("POSSIBLE THROW : " + ScoreTable1[n].bed);
if (ChosenShotID == 9999) {
ChosenShotID = n;
}
}
n++;
}
}
if ((randNumber >= 14) && (randNumber < 17)) {
n = 0;
while (n < ScoreTable1.length) {
if (ScoreTable1[n].number == 57) {
trace("POSSIBLE THROW : " + ScoreTable1[n].bed);
if (ChosenShotID == 9999) {
ChosenShotID = n;
}
}
n++;
}
}
if (randNumber >= 17) {
n = 0;
while (n < ScoreTable1.length) {
if (ScoreTable1[n].number == 51) {
trace("POSSIBLE THROW : " + ScoreTable1[n].bed);
if (ChosenShotID == 9999) {
ChosenShotID = n;
}
}
n++;
}
}
}
trace("FINAL SHOT CHOSEN (DART 2): " + ScoreTable1[ChosenShotID].bed);
randNumber = math.random() * ((ScoreTable1[ChosenShotID].radius2 - ScoreTable1[ChosenShotID].radius1) + ComputerSkill);
ComputerRadius = randNumber + (ScoreTable1[ChosenShotID].radius1 - (ComputerSkill / 2));
trace("RADIUS OF SHOT : " + ComputerRadius);
randNumber = math.random() * ((ScoreTable1[ChosenShotID].angle2 - ScoreTable1[ChosenShotID].angle1) + ComputerSkill);
ComputerAngle = randNumber + (ScoreTable1[ChosenShotID].angle1 - (ComputerSkill / 2));
trace("ANGLE OF SHOT : " + ComputerAngle);
TEMPradian = (Math.PI/180) * ComputerAngle;
randNumber = Math.random() * 20;
if (randNumber > 9) {
TEMPsign_x = 1;
} else {
TEMPsign_x = -1;
}
randNumber = Math.random() * 20;
if (randNumber > 9) {
TEMPsign_y = 1;
} else {
TEMPsign_y = -1;
}
if (ScoreTable1[ChosenShotID].toplevel == 20) {
TEMPsign_y = -1;
}
if (ScoreTable1[ChosenShotID].toplevel == 3) {
TEMPsign_y = 1;
}
if (ScoreTable1[ChosenShotID].toplevel == 6) {
TEMPsign_x = 1;
}
if (ScoreTable1[ChosenShotID].toplevel == 11) {
TEMPsign_x = -1;
}
if ((((ScoreTable1[ChosenShotID].toplevel == 1) || (ScoreTable1[ChosenShotID].toplevel == 18)) || (ScoreTable1[ChosenShotID].toplevel == 4)) || (ScoreTable1[ChosenShotID].toplevel == 13)) {
TEMPsign_x = 1;
TEMPsign_y = -1;
}
if ((((ScoreTable1[ChosenShotID].toplevel == 5) || (ScoreTable1[ChosenShotID].toplevel == 12)) || (ScoreTable1[ChosenShotID].toplevel == 9)) || (ScoreTable1[ChosenShotID].toplevel == 14)) {
TEMPsign_x = -1;
TEMPsign_y = -1;
}
if ((((ScoreTable1[ChosenShotID].toplevel == 8) || (ScoreTable1[ChosenShotID].toplevel == 16)) || (ScoreTable1[ChosenShotID].toplevel == 7)) || (ScoreTable1[ChosenShotID].toplevel == 19)) {
TEMPsign_x = -1;
TEMPsign_y = 1;
}
if ((((ScoreTable1[ChosenShotID].toplevel == 10) || (ScoreTable1[ChosenShotID].toplevel == 15)) || (ScoreTable1[ChosenShotID].toplevel == 2)) || (ScoreTable1[ChosenShotID].toplevel == 17)) {
TEMPsign_x = 1;
TEMPsign_y = 1;
}
shot_x = (ComputerRadius * Math.sin(TEMPradian)) * TEMPsign_x;
trace("X COORD : " + shot_x);
shot_y = (ComputerRadius * Math.cos(TEMPradian)) * TEMPsign_y;
trace("Y COORD : " + shot_y);
_root.objCross._x = _root.movBoard._x + shot_x;
_root.objCross._y = _root.movBoard._y + shot_y;
duplicateMovieClip (_root.objDartb, "objDart2", 1002);
_root.objDart2._x = _root.movBoard._x + shot_x;
_root.objDart2._y = _root.movBoard._y + shot_y;
_root.runningTotal_2 = _root.runningTotal_2 + _root.CalculateScore(_root.objDart2._x, _root.objDart2._y);
Darts_2++;
if ((RemainingScore_2 - runningTotal_2) <= 1) {
gotoAndPlay (141);
} else {
gotoAndPlay (111);
}
Instance of Symbol 124 MovieClip "objDartb" in Frame 101
onClipEvent (load) {
counter = 23;
dscale = 300;
}
onClipEvent (enterFrame) {
counter--;
if (counter >= 0) {
dscale = dscale * 0.92;
_xscale = dscale;
_yscale = dscale;
}
if (counter == 3) {
}
}
Frame 111
_root.txtScores.text = "Current Score: " + RunningTotal_2;
stop();
Instance of Symbol 133 MovieClip "Timer1" in Frame 111
onClipEvent (load) {
counter = 0;
}
onClipEvent (enterFrame) {
counter++;
if (counter > _root.CPUSpeed) {
if ((math.random() * 20) > 18) {
_root.gotoAndStop("Comp 3");
}
}
}
Frame 121
var n;
var i;
var randNumber;
var ChosenShotID;
var Required;
var Shot_x;
var Shot_y;
AddDarts = 0;
ChosenShotID = 9999;
trace("REMAINING SCORE : " + (RemainingScore_2 - runningTotal_2));
if ((((RemainingScore_2 - runningTotal_2) < 41) && (((RemainingScore_2 - runningTotal_2) % 2) == 0)) && ((RemainingScore_2 - runningTotal_2) > 1)) {
trace("LOOKING FOR DOUBLE TO THROW");
n = 0;
while (n < ScoreTable1.length) {
if ((ScoreTable1[n].number == (RemainingScore_2 - runningTotal_2)) && (ScoreTable1[n].bed.indexOf("D", 0) != -1)) {
trace("POSSIBLE THROW : " + ScoreTable1[n].bed);
if (ChosenShotID == 9999) {
ChosenShotID = n;
}
}
n++;
}
}
if ((((RemainingScore_2 - runningTotal_2) < 41) && (((RemainingScore_2 - runningTotal_2) % 2) == 1)) && ((RemainingScore_2 - runningTotal_2) > 1)) {
trace("LOOKING TO LEAVE DOUBLE ON NEXT THROW");
if ((RemainingScore_2 - runningTotal_2) > 32) {
Required = (RemainingScore_2 - runningTotal_2) - 32;
}
if (((RemainingScore_2 - runningTotal_2) > 16) && ((RemainingScore_2 - runningTotal_2) < 32)) {
Required = (RemainingScore_2 - runningTotal_2) - 16;
}
if (((RemainingScore_2 - runningTotal_2) > 8) && ((RemainingScore_2 - runningTotal_2) < 16)) {
Required = (RemainingScore_2 - runningTotal_2) - 8;
}
if (((RemainingScore_2 - runningTotal_2) > 4) && ((RemainingScore_2 - runningTotal_2) < 8)) {
Required = (RemainingScore_2 - runningTotal_2) - 4;
}
if (((RemainingScore_2 - runningTotal_2) > 2) && ((RemainingScore_2 - runningTotal_2) < 4)) {
Required = (RemainingScore_2 - runningTotal_2) - 2;
}
trace("REQUIRED TO LEAVE DOUBLE : " + Required);
n = 0;
while (n < ScoreTable1.length) {
if (ScoreTable1[n].number == Required) {
trace("POSSIBLE THROW : " + ScoreTable1[n].bed);
if (ChosenShotID == 9999) {
ChosenShotID = n;
}
}
n++;
}
}
i = 0;
while (i < CheckoutTable2.length) {
if (CheckoutTable2[i].number == (RemainingScore_2 - runningTotal_2)) {
trace("LOOKING FOR 2 DART CHECKOUT");
n = 0;
while (n < ScoreTable1.length) {
if (ScoreTable1[n].bed == CheckoutTable2[i].bed) {
trace("POSSIBLE THROW : " + ScoreTable1[n].bed);
if (ChosenShotID == 9999) {
ChosenShotID = n;
}
}
n++;
}
}
i++;
}
i = 0;
while (i < CheckoutTable3.length) {
if (CheckoutTable3[i].number == (RemainingScore_2 - runningTotal_2)) {
trace("LOOKING FOR 3 DART CHECKOUT");
n = 0;
while (n < ScoreTable1.length) {
if (ScoreTable1[n].bed == CheckoutTable3[i].bed) {
trace("POSSIBLE THROW : " + ScoreTable1[n].bed);
if (ChosenShotID == 9999) {
ChosenShotID = n;
}
}
n++;
}
}
i++;
}
if ((((RemainingScore_2 - runningTotal_2) % 2) == 0) || (((((((RemainingScore_2 - runningTotal_2) == 501) || ((RemainingScore_2 - runningTotal_2) == 441)) || ((RemainingScore_2 - runningTotal_2) == 381)) || ((RemainingScore_2 - runningTotal_2) == 321)) || ((RemainingScore_2 - runningTotal_2) == 261)) || ((RemainingScore_2 - runningTotal_2) == 201))) {
trace("LOOKING FOR 9 DART GAME");
n = 0;
while (n < ScoreTable1.length) {
if (ScoreTable1[n].number == 60) {
trace("POSSIBLE THROW : " + ScoreTable1[n].bed);
if (ChosenShotID == 9999) {
ChosenShotID = n;
}
}
n++;
}
}
if (((RemainingScore_2 - runningTotal_2) % 2) == 1) {
trace("LOOKING FOR STANDARD THROW");
randNumber = Math.random() * 20;
if (randNumber < 14) {
n = 0;
while (n < ScoreTable1.length) {
if (ScoreTable1[n].number == 60) {
trace("POSSIBLE THROW : " + ScoreTable1[n].bed);
if (ChosenShotID == 9999) {
ChosenShotID = n;
}
}
n++;
}
}
if ((randNumber >= 14) && (randNumber < 17)) {
n = 0;
while (n < ScoreTable1.length) {
if (ScoreTable1[n].number == 57) {
trace("POSSIBLE THROW : " + ScoreTable1[n].bed);
if (ChosenShotID == 9999) {
ChosenShotID = n;
}
}
n++;
}
}
if (randNumber >= 17) {
n = 0;
while (n < ScoreTable1.length) {
if (ScoreTable1[n].number == 51) {
trace("POSSIBLE THROW : " + ScoreTable1[n].bed);
if (ChosenShotID == 9999) {
ChosenShotID = n;
}
}
n++;
}
}
}
trace("FINAL SHOT CHOSEN (DART 2): " + ScoreTable1[ChosenShotID].bed);
randNumber = math.random() * ((ScoreTable1[ChosenShotID].radius2 - ScoreTable1[ChosenShotID].radius1) + ComputerSkill);
ComputerRadius = randNumber + (ScoreTable1[ChosenShotID].radius1 - (ComputerSkill / 2));
trace("RADIUS OF SHOT : " + ComputerRadius);
randNumber = math.random() * ((ScoreTable1[ChosenShotID].angle2 - ScoreTable1[ChosenShotID].angle1) + ComputerSkill);
ComputerAngle = randNumber + (ScoreTable1[ChosenShotID].angle1 - (ComputerSkill / 2));
trace("ANGLE OF SHOT : " + ComputerAngle);
TEMPradian = (Math.PI/180) * ComputerAngle;
randNumber = Math.random() * 20;
if (randNumber > 9) {
TEMPsign_x = 1;
} else {
TEMPsign_x = -1;
}
randNumber = Math.random() * 20;
if (randNumber > 9) {
TEMPsign_y = 1;
} else {
TEMPsign_y = -1;
}
if (ScoreTable1[ChosenShotID].toplevel == 20) {
TEMPsign_y = -1;
}
if (ScoreTable1[ChosenShotID].toplevel == 3) {
TEMPsign_y = 1;
}
if (ScoreTable1[ChosenShotID].toplevel == 6) {
TEMPsign_x = 1;
}
if (ScoreTable1[ChosenShotID].toplevel == 11) {
TEMPsign_x = -1;
}
if ((((ScoreTable1[ChosenShotID].toplevel == 1) || (ScoreTable1[ChosenShotID].toplevel == 18)) || (ScoreTable1[ChosenShotID].toplevel == 4)) || (ScoreTable1[ChosenShotID].toplevel == 13)) {
TEMPsign_x = 1;
TEMPsign_y = -1;
}
if ((((ScoreTable1[ChosenShotID].toplevel == 5) || (ScoreTable1[ChosenShotID].toplevel == 12)) || (ScoreTable1[ChosenShotID].toplevel == 9)) || (ScoreTable1[ChosenShotID].toplevel == 14)) {
TEMPsign_x = -1;
TEMPsign_y = -1;
}
if ((((ScoreTable1[ChosenShotID].toplevel == 8) || (ScoreTable1[ChosenShotID].toplevel == 16)) || (ScoreTable1[ChosenShotID].toplevel == 7)) || (ScoreTable1[ChosenShotID].toplevel == 19)) {
TEMPsign_x = -1;
TEMPsign_y = 1;
}
if ((((ScoreTable1[ChosenShotID].toplevel == 10) || (ScoreTable1[ChosenShotID].toplevel == 15)) || (ScoreTable1[ChosenShotID].toplevel == 2)) || (ScoreTable1[ChosenShotID].toplevel == 17)) {
TEMPsign_x = 1;
TEMPsign_y = 1;
}
shot_x = (ComputerRadius * Math.sin(TEMPradian)) * TEMPsign_x;
trace("X COORD : " + shot_x);
shot_y = (ComputerRadius * Math.cos(TEMPradian)) * TEMPsign_y;
trace("Y COORD : " + shot_y);
_root.objCross._x = _root.movBoard._x + shot_x;
_root.objCross._y = _root.movBoard._y + shot_y;
duplicateMovieClip (_root.objDartc, "objDart3", 1003);
_root.objDart3._x = _root.movBoard._x + shot_x;
_root.objDart3._y = _root.movBoard._y + shot_y;
_root.runningTotal_2 = _root.runningTotal_2 + _root.CalculateScore(_root.objDart3._x, _root.objDart3._y);
Darts_2++;
if ((RemainingScore_2 - runningTotal_2) <= 1) {
gotoAndPlay (141);
} else {
_root.txtScores.text = "";
gotoAndPlay (141);
}
Instance of Symbol 124 MovieClip "objDartc" in Frame 121
onClipEvent (load) {
counter = 23;
dscale = 300;
}
onClipEvent (enterFrame) {
counter--;
if (counter >= 0) {
dscale = dscale * 0.92;
_xscale = dscale;
_yscale = dscale;
}
if (counter == 3) {
}
}
Frame 131
_root.txtScores.text = "";
Instance of Symbol 133 MovieClip "Timer1" in Frame 131
/* no clip actions */
Frame 141
Darts_2 = Darts_2 + AddDarts;
trace("CPU DARTS USED : " + Darts_2);
if (((RemainingScore_2 - runningTotal_2) == 0) and (_root.Lastradius < 110)) {
if (_root.LastRadius < 10) {
movScoreFlow.counter = 0;
movScoreFlow.scale = 0;
movScoreFlow.txtScoreFlow = "Game Shot!";
GameOver = true;
} else {
_root.movScoreFlow.counter = 0;
_root.movScoreFlow.scale = 0;
_root.movScoreFlow.txtScoreFlow = "No Score!";
_root.objSliders.objSliderTop.slide = 0;
_root.objSliders.objSliderRight.slide = 0;
}
} else if ((RemainingScore_2 - runningTotal_2) <= 1) {
if ((_root.lastradius >= 110) and ((RemainingScore_2 - runningTotal_2) == 0)) {
if (_root.Lastradius <= 118) {
movScoreFlow.counter = 0;
movScoreFlow.scale = 0;
movScoreFlow.txtScoreFlow = "Game Shot!";
GameOver = true;
}
} else if ((remainingScore_2 - runningTotal_2) <= 1) {
movScoreFlow.counter = 0;
movScoreFlow.scale = 0;
movScoreFlow.txtScoreFlow = "No Score!";
}
} else {
RemainingScore_2 = RemainingScore_2 - runningTotal_2;
movScoreFlow.counter = 0;
movScoreFlow.scale = 0;
movScoreFlow.txtScoreFlow = runningTotal_2;
}
setProperty("strike1_" + _root.Darts_2, _alpha , 100);
stop();
Instance of Symbol 133 MovieClip "Timer1" in Frame 141
onClipEvent (load) {
counter = 0;
}
onClipEvent (enterFrame) {
counter++;
if (counter == 26) {
_root.txtStatusDisplay = _root.txtStatus;
}
if (counter == 54) {
if (_root.Darts_2 > 33) {
if (_root.Darts_2 > 36) {
_root.txtCPUScore_2 = _root.txtCPUScore_2 + (newline + _root.RemainingScore_2);
} else {
_root.txtCPUScore_2 = _root.RemainingScore_2;
}
} else {
_root.txtCPUScore_1 = _root.txtCPUScore_1 + (newline + _root.RemainingScore_2);
}
_root.txtStatusDisplay = "";
if (_root.GameOver == false) {
_root.gotoAndStop("Dart 1");
} else {
_root.Legs_2 = _root.Legs_2 + 1;
_root.gotoAndStop("End");
}
}
}
Frame 151
play();
Frame 175
ThrowFirst = ThrowFirst * -1;
_root.txtCPULegs = "Legs: " + Legs_2;
_root.txtP1Legs = "Legs: " + Legs_1;
_root.txtCPUScore_1 = "501";
_root.txtCPUScore_2 = "";
_root.txtP1Score_1 = "501";
_root.txtP1Score_2 = "";
if ((Legs_1 == 3) || (Legs_2 == 3)) {
gotoAndStop (181);
} else {
gotoAndStop (30);
}
stop();
Frame 181
_root.objDart1._visible = false;
_root.objDart2._visible = false;
_root.objDart3._visible = false;
if (Legs_1 > Legs_2) {
_root.txtTitle = "Well Done!";
_root.txtDetails = (((("You beat " + _root.txtCPUName) + " by ") + Legs_1) + " legs to ") + Legs_2;
_root.txtDetails = _root.txtDetails + "\n\nThank you for playing Bullseye! Matchplay.\nTry to play the next best player until you beat them all!";
_root.txtDetails = _root.txtDetails + "\n\nIf you would like to sponser/license this game please contact me... games@johntear.com";
} else {
_root.txtTitle = "Bad Luck!";
_root.txtDetails = (((("You were beaten by " + Legs_2) + " legs to ") + Legs_1) + " by ") + _root.txtCPUName;
_root.txtDetails = _root.txtDetails + "\n\nThank you for playing Bullseye! Matchplay.\nTry again until you can beat your last opponent! Or you can always try to beat an easier player.";
_root.txtDetails = _root.txtDetails + "\n\nIf you would like to sponser/license this game please contact me... games@johntear.com";
}
Instance of Symbol 8 MovieClip "objProgress" in Symbol 13 MovieClip Frame 1
onClipEvent (load) {
_root.stop();
_parent.txtSize = "[";
_parent.txtSize = _parent.txtSize + Math.round(_root.getBytesTotal() / 1000);
_parent.txtSize = _parent.txtSize + "k]";
}
onClipEvent (enterFrame) {
loaded = _root.getBytesLoaded();
remaining = _root.getBytesTotal();
_xscale = (((loaded / remaining) * 100) * 2);
_x = -38.3;
_parent.txtPerc = Math.round((loaded / remaining) * 100) + "%";
if (loaded == remaining) {
_root.GotoAndPlay("Functions");
}
}
Instance of Symbol 35 MovieClip "objSliderRight" in Symbol 38 MovieClip Frame 1
onClipEvent (load) {
dy = 4;
slide = 0;
}
onClipEvent (enterFrame) {
if (slide == 1) {
_y = (_y + dy);
if (_y <= -37) {
dy = dy * -1;
}
if (_y >= 34) {
dy = dy * -1;
}
}
}
Instance of Symbol 35 MovieClip "objSliderTop" in Symbol 38 MovieClip Frame 1
onClipEvent (load) {
dx = 4;
slide = 0;
}
onClipEvent (enterFrame) {
if (slide == 1) {
_x = (_x + dx);
if (_x <= -37) {
dx = dx * -1;
}
if (_x >= 34) {
dx = dx * -1;
}
}
}
Symbol 44 Button
on (release) {
PlayerName = txtPlayer.text;
_root.gotoAndPLay("Initialise");
}
Symbol 48 Button
on (release) {
switch (_root.txtOpponent.text) {
case "Jim Boeing (Very Easy)" :
_root.txtOpponent.text = "Keith Della (Easy)";
ChosenPlayerSkill = 15;
txtCPUName = "Keith Della";
break;
case "Keith Della (Easy)" :
_root.txtOpponent.text = "Jokey Wilson (Average)";
txtCPUName = "Jokey Wilson";
ChosenPlayerSkill = 10;
break;
case "Jokey Wilson (Average)" :
_root.txtOpponent.text = "Tony Davids (Hard)";
txtCPUName = "Tony Davids";
ChosenPlayerSkill = 6;
break;
case "Tony Davids (Hard)" :
_root.txtOpponent.text = "Phil Tailor (Very Hard)";
txtCPUName = "Phil Tailor";
ChosenPlayerSkill = 2;
break;
case "Phil Tailor (Very Hard)" :
_root.txtOpponent.text = "Jim Boeing (Very Easy)";
txtCPUName = "Jim Boeing";
ChosenPlayerSkill = 20;
break;
default :
trace("oops there is a problem!!!");
}
}
Symbol 70 Button
on (release) {
_boxstatus = 1;
_root.FastPlay = 1;
gotoAndPlay (10);
}
Symbol 72 Button
on (release) {
_boxstatus = 0;
_root.FastPlay = 0;
gotoAndPlay (1);
}
Symbol 73 MovieClip Frame 1
stop();
Symbol 73 MovieClip Frame 10
stop();
Symbol 124 MovieClip Frame 24
stop();
Symbol 125 Button
on (press) {
if (_root.objSliders.objSliderTop.slide == 1) {
_root.objSliders.objSliderTop.slide = 0;
_root.objSliders.objSliderRight.slide = 1;
} else if (_root.objSliders.objSliderRight.slide == 1) {
_root.objSliders.objSliderTop.slide = 1;
_root.objSliders.objSliderRight.slide = 0;
duplicateMovieClip (_root.objDarta, "objDart1", 1001);
_root.objDart1._x = (_root.movBoard._x + ((Math.random() * 10) - 5)) + (_root.objSliders.objSliderTop._x * 4);
_root.objDart1._y = (_root.movBoard._y + ((Math.random() * 10) - 5)) + (_root.objSliders.objSliderRight._y * 4);
_root.runningTotal_1 = _root.runningTotal_1 + _root.CalculateScore(_root.objDart1._x, _root.objDart1._y);
Darts_1++;
if ((RemainingScore_1 - runningTotal_1) <= 1) {
gotoAndPlay (70);
} else {
gotoAndStop (50);
}
}
}
Instance of Symbol 35 MovieClip "objSliderRight" in Symbol 126 MovieClip Frame 1
onClipEvent (load) {
dy = 4;
slide = 0;
}
onClipEvent (enterFrame) {
if (slide == 1) {
_y = (_y + dy);
if (_y <= -37) {
dy = dy * -1;
}
if (_y >= 34) {
dy = dy * -1;
}
}
}
Instance of Symbol 35 MovieClip "objSliderTop" in Symbol 126 MovieClip Frame 1
onClipEvent (load) {
dx = 4;
slide = 1;
}
onClipEvent (enterFrame) {
if (slide == 1) {
_x = (_x + dx);
if (_x <= -37) {
dx = dx * -1;
}
if (_x >= 34) {
dx = dx * -1;
}
}
}
Symbol 128 Button
on (press) {
if (_root.objSliders.objSliderTop.slide == 1) {
_root.objSliders.objSliderTop.slide = 0;
_root.objSliders.objSliderRight.slide = 1;
} else if (_root.objSliders.objSliderRight.slide == 1) {
_root.objSliders.objSliderTop.slide = 1;
_root.objSliders.objSliderRight.slide = 0;
duplicateMovieClip (_root.objDartb, "objDart2", 1002);
_root.objDart2._x = (_root.movBoard._x + ((Math.random() * 10) - 5)) + (_root.objSliders.objSliderTop._x * 4);
_root.objDart2._y = (_root.movBoard._y + ((Math.random() * 10) - 5)) + (_root.objSliders.objSliderRight._y * 4);
_root.runningTotal_1 = _root.runningTotal_1 + _root.CalculateScore(_root.objDart2._x, _root.objDart2._y);
if ((_root.RemainingScore_1 - _root.runningTotal_1) <= 1) {
_root.gotoAndPlay("Player Score");
}
Darts_1++;
if ((RemainingScore_1 - runningTotal_1) <= 1) {
gotoAndPlay (70);
} else {
gotoAndStop (60);
}
}
}
Symbol 129 Button
on (press) {
if (_root.objSliders.objSliderTop.slide == 1) {
_root.objSliders.objSliderTop.slide = 0;
_root.objSliders.objSliderRight.slide = 1;
} else if (_root.objSliders.objSliderRight.slide == 1) {
_root.objSliders.objSliderTop.slide = 0;
_root.objSliders.objSliderRight.slide = 0;
duplicateMovieClip (_root.objDartc, "objDart3", 1003);
_root.objDart3._x = (_root.movBoard._x + ((Math.random() * 10) - 5)) + (_root.objSliders.objSliderTop._x * 4);
_root.objDart3._y = (_root.movBoard._y + ((Math.random() * 10) - 5)) + (_root.objSliders.objSliderRight._y * 4);
_root.runningTotal_1 = _root.runningTotal_1 + _root.CalculateScore(_root.objDart3._x, _root.objDart3._y);
if ((_root.RemainingScore_1 - _root.runningTotal_1) <= 1) {
_root.gotoAndPlay("Player Score");
}
Darts_1++;
gotoAndPlay (70);
}
}
Symbol 138 Button
on (release) {
_root.gotoAndPLay("Instructions");
}