Copy link to clipboard
Copied
Hey there,
iam making a shell game and found the following code on the web but want to remove one shell so that its 3 shells instead of 4. After removing the myBall = 4 on my own the game wont work right anymore, so sometimes the right shell is not the one it is supposed to be.
Can you help me to remove the myBall = 4 while still keep the logic working?
nClipEvent (load) {
stopped = true;
myCTR = -1;
w = 0;
}
onClipEvent (enterFrame) {
if (myCTR<=_parent.ctr && myCTR>=0) {
if (stopped) {
w = Math.ceil((random(60)+1)/10);
if (w == 1) {
if (myBall == 1) {
myBall = 2;
} else if (myBall == 2) {
myBall = 1;
}
} else if (w == 2) {
if (myBall == 3) {
myBall = 4;
} else if (myBall == 4) {
myBall = 3;
}
} else if (w == 3) {
if (myBall == 3) {
myBall = 2;
} else if (myBall == 2) {
myBall = 3;
}
} else if (w == 4) {
if (myBall == 3) {
myBall = 1;
} else if (myBall == 1) {
myBall = 3;
}
} else if (w == 5) {
if (myBall == 2) {
myBall = 4;
} else if (myBall == 4) {
myBall = 2;
}
} else if (w == 6) {
w = random(3)+6;
}
gotoAndPlay("f"+String(w));
myCTR++;
stopped = false;
}
} else if (_parent.ctr>4 && myCTR>_parent.ctr) {
if (_parent._currentframe != 5) {
if (w == 1) {
if (myBall == 1) {
myBall = 2;
} else if (myBall == 2) {
myBall = 1;
}
} else if (w == 2) {
if (myBall == 3) {
myBall = 4;
} else if (myBall == 4) {
myBall = 3;
}
} else if (w == 3) {
if (myBall == 3) {
myBall = 2;
} else if (myBall == 2) {
myBall = 3;
}
} else if (w == 4) {
if (myBall == 3) {
myBall = 1;
} else if (myBall == 1) {
myBall = 3;
}
} else if (w == 5) {
if (myBall == 2) {
myBall = 4;
} else if (myBall == 4) {
myBall = 2;
}
}
_parent.gotoAndStop(5);
gotoAndStop("guess");
}
}
}
Copy link to clipboard
Copied
1. that's not as3 code.
2. that's poorly coded as1/as2 code.
you should rewrite that code in as3.
Copy link to clipboard
Copied
ok but i have no clue about coding AS thats why i need help editing what i have so far.
Copy link to clipboard
Copied
the adobe forums are good places to get help. ie, anyone can ask a question and, if there are no files to download and not much code to correct, expect a helpful answer.
but asking someone to do your work for you is not as likely. you may be lucky and find someone that will that, but you'll need to be patient.
if you don't want to wait, you should hire someone to do your project for you.
Copy link to clipboard
Copied
Ok so hire someone might be the best solution. thanks for your help
Copy link to clipboard
Copied
you're welcome.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now