
June 20th, 2007, 09:25 AM
|
|
Registered User
|
|
Join Date: Jun 2007
Posts: 1
Time spent in forums: 24 m 19 sec
Reputation Power: 0
|
|
|
Help anyone?
ok i'm doing a project for school and i have to program a green globs game here's the majority of my code do u have any suggestions?
The code is in Actionscript for FlashMX
Code:
mag = 80;
wid = 200;
hei = 200;
OX = 0;
OY = 0;
lineStyle(1, 0x000000, 100);
moveTo(0, 200);
lineTo(0, -200);
moveTo(200, 0);
lineTo(-200, 0);
//
//
moveTo(200, 200);
lineTo(200, -200);
moveTo(200, -200);
lineTo(-200, -200);
moveTo(-200, -200);
lineTo(-200, 200);
moveTo(-200, 200);
lineTo(200, 200);
lineStyle(3, 0x0000FF, 100);
for (var c = -1.25; c<=+1.25; c++) {
}
lineStyle(3, 0x000000, 100);
for (var c = -10; c<=+10; c++) {
moveTo(OX-c*20, OY-1);
lineTo(OX-c*20, OY+1);
moveTo(OX-1, OY-c*20);
lineTo(OX+1, OY-c*20);
}
function onOK() {
B = b;
M = M;
if (M>0) {
Y1 = (((-M)*10)-B);
if ((Y1<=10) and (Y1>=-10)) {
XFin = 200;
YFin = Y1*20;
}
X1 = ((10-B)/(M));
if ((Y1>=10) or (Y1<=-10)) {
XFin = X1*20;
YFin = -200;
}
Y2 = (((-M)*-10)-B);
if ((Y2<=10) and (Y2>=-10)) {
NXFin = -200;
NYFin = Y2*20;
}
X2 = ((-10-B)/(M));
if ((Y2>=10) or (Y2<=-10)) {
NXFin = X2*20;
NYFin = 200;
}
}
if (M<0) {
Y1 = (((M)*10)-B);
if ((Y1<=10) and (Y1>=-10)) {
XFin = -200;
YFin = Y1*20;
}
if ((Y1>=10) or (Y1<=-10)) {
X1 = ((10-B)/(-M));
XFin = -X1*20;
YFin = -200;
}
Y2 = (((M)*-10)-B);
if ((Y2<=10) and (Y2>=-10)) {
NXFin = 200;
NYFin = Y2*20;
}
X2 = ((-10-B)/(-M));
if ((Y2>=10) or (Y2<=-10)) {
NXFin = -X2*20;
NYFin = 200;
}
}
if (M == 0) {
XFin = 200;
YFin = -B*20;
NXFin = -200;
NYFin = -B*20;
}
lineStyle(3, 0x000000, 100);
moveTo(XFin, YFin);
lineTo(NXFin, NYFin);
//
//
Y3=(((-M*(_root.ball1._x/20))-B)*20)
Y4=((_root.ball1._y)-Y3)
if((Y4<12.5) and (Y4>-12.5)){
_root.ball1.gotoAndPlay("break");
}
Y5=(((-M*(_root.ball2._x/20))-B)*20)
Y6=((_root.ball2._y)-Y5)
if((Y6<12.5) and (Y6>-12.5)){
_root.ball2.gotoAndPlay("break");
}
Y7=(((-M*(_root.ball3._x/20))-B)*20)
Y8=((_root.ball3._y)-Y7)
if((Y8<12.5) and (Y8>-12.5)){
_root.ball3.gotoAndPlay("break");
}
Y9=(((-M*(_root.ball4._x/20))-B)*20)
Y10=((_root.ball4._y)-Y9)
if((Y10<12.5) and (Y10>-12.5)){
_root.ball4.gotoAndPlay("break");
}
Y11=(((-M*(_root.ball5._x/20))-B)*20)
Y12=((_root.ball5._y)-Y11)
if((Y12<12.5) and (Y12>-12.5)){
_root.ball5.gotoAndPlay("break");
}
Y13=(((-M*(_root.ball6._x/20))-B)*20)
Y14=((_root.ball6._y)-Y13)
if((Y14<12.5) and (Y14>-12.5)){
_root.ball6.gotoAndPlay("break");
}
Y15=(((-M*(_root.ball7._x/20))-B)*20)
Y16=((_root.ball7._y)-Y15)
if((Y16<12.5) and (Y16>-12.5)){
_root.ball7.gotoAndPlay("break");
}
Y17=(((-M*(_root.ball8._x/20))-B)*20)
Y18=((_root.ball8._y)-Y17)
if((Y18<12.5) and (Y18>-12.5)){
_root.ball8.gotoAndPlay("break");
}
Y19=(((-M*(_root.ball9._x/20))-B)*20)
Y20=((_root.ball9._y)-Y19)
if((Y20<12.5) and (Y20>-12.5)){
_root.ball9.gotoAndPlay("break");
}
Y21=(((-M*(_root.ball10._x/20))-B)*20)
Y22=((_root.ball10._y)-Y21)
if((Y22<12.5) and (Y22>-12.5)){
_root.ball10.gotoAndPlay("break");
}
Y23=(((-M*(_root.ball11._x/20))-B)*20)
Y24=((_root.ball11._y)-Y23)
if((Y24<12.5) and (Y24>-12.5)){
_root.ball11.gotoAndPlay("break");
}
Y25=(((-M*(_root.ball12._x/20))-B)*20)
Y26=((_root.ball12._y)-Y25)
if((Y26<12.5) and (Y26>-12.5)){
_root.ball12.gotoAndPlay("break");
}
Y27=(((-M*(_root.ball13._x/20))-B)*20)
Y28=((_root.ball13._y)-Y27)
if((Y28<12.5) and (Y28>-12.5)){
_root.ball13.gotoAndPlay("break");
}
Y29=(((-M*(_root.ball14._x/20))-B)*20)
Y30=((_root.ball14._y)-Y29)
if((Y30<12.5) and (Y30>-12.5)){
_root.ball14.gotoAndPlay("break");
}
Y31=(((-M*(_root.ball15._x/20))-B)*20)
Y32=((_root.ball15._y)-Y31)
if((Y32<12.5) and (Y32>-12.5)){
_root.ball15.gotoAndPlay("break");
}
}
stop();
|