ninjacore
01-02-2003, 07:58 PM
ok. doing a game for uni. its a remake of the thing where u have to hit boxes with a ball, that u hit with a sliding paddle. all hunky dory so far!
what i really need to know is, how can i tell flash that ALL the BOXES have been hit, and then to move onto a "congradualtions" scene? heres a sample of my script from the beginning,...
if ((ball._x<=5) || (ball._x>495)) {
// trace("x bounce");
xStep = -xStep;
}
if ((ball._y<=5)) {
// trace("y bounce");
yStep = -yStep;
}
if (ball._y>400) {
// trace("restarting");
gotoAndPlay (5);
}
ball._x += xStep;
// trace("moving ball");
ball._y += yStep;
paddle._x = _xmouse;
if (paddle._x<=10) {
paddle._x = 10;
}
if (paddle._x>=490) {
paddle._x = 490;
}
if (paddle.hitTest(ball)) {
yStep = -10;
}
if (ball.hitTest(box)) {
sound("Smack");
box._X = 510;
box._y = 450;
yStep = -yStep;
}
if (ball.hitTest(box1)) {
box1._X = 510;
box1._y = 450;
yStep = -yStep;
x = 510 and y = 450 is where the boxes go when they are hit!
also, i need a sound to play when a box is hit!!
Any advice on a score bar would be amazing, but its not essential.
Help is VERY appreciated!!!!!!!!!!!:D :D :D :confused:
what i really need to know is, how can i tell flash that ALL the BOXES have been hit, and then to move onto a "congradualtions" scene? heres a sample of my script from the beginning,...
if ((ball._x<=5) || (ball._x>495)) {
// trace("x bounce");
xStep = -xStep;
}
if ((ball._y<=5)) {
// trace("y bounce");
yStep = -yStep;
}
if (ball._y>400) {
// trace("restarting");
gotoAndPlay (5);
}
ball._x += xStep;
// trace("moving ball");
ball._y += yStep;
paddle._x = _xmouse;
if (paddle._x<=10) {
paddle._x = 10;
}
if (paddle._x>=490) {
paddle._x = 490;
}
if (paddle.hitTest(ball)) {
yStep = -10;
}
if (ball.hitTest(box)) {
sound("Smack");
box._X = 510;
box._y = 450;
yStep = -yStep;
}
if (ball.hitTest(box1)) {
box1._X = 510;
box1._y = 450;
yStep = -yStep;
x = 510 and y = 450 is where the boxes go when they are hit!
also, i need a sound to play when a box is hit!!
Any advice on a score bar would be amazing, but its not essential.
Help is VERY appreciated!!!!!!!!!!!:D :D :D :confused: