Hey im just getting use to action script and i started out trying to make a simple game of pong with this tutorial but there were some problems
it told me to make a paddle mc and a ball mc 2 dynamic tex box and some other stuff its called tutorial collab 08 if you wanna get deep with it but heres the code
dirx = -5;
diry = 5;
bad = 0;
good = 0;
cpuy = 0;
that part worked fine then comes this part
onEnterFrame = function () {
ball._x += dirx;
ball._y += diry;
if (_ymouse>164.3) {
if (_ymouse<546.3-you._height) {
you._y = _ymouse;
} else {
you._y = 546.3-you._height;
}
} else {
you._y = 164.3;
}
if (cpu._y<546.3-cpu._height) {
if (cpu._y>164.3) {
cpu._y += cpuy;
} else if (ball._y>cpu._y+cpu._height) {
cpu._y = 164.4;
} else {
cpu._y = 164.3;
}
} else if (ball._y<cpu._y) {
cpu._y = 546.2-cpu._height;
} else {
cpu._y = 546.3-cpu._height;
}
It said it wouldn't work and if i put a } on the end it would well it did but here come the part that didn't
if (ball._y<164.3+ball._height/2) {
ball._y = 164.3+ball._height/2;
diry *= -1;
}
if (ball._y>546.3-ball._height/2) {
ball._y = 546.3-ball._height/2;
diry *= -1;
}
if (ball._x>600-ball._width/2) {
bad++;
ball._x = 300;
ball._y = 300;
diry = 5;
dirx = 5;
}
if (ball._x<0+ball._width/2) {
good++;
ball._x = 300;
ball._y = 300;
diry = -5;
dirx = 5;
}
if (ball.hitTest(cpu)) {
if (ball._x>cpu._x-cpu._width) {
ball._x = cpu._x+ball._width/2;
dirx *= -1.1;
diry += -10+((ball._y-cpu._y)/4);
}
}
if (ball.hitTest(you)) {
if (ball._x<you._x+you._width) {
ball._x = you._x-ball._width/2;
dirx *= -1.1;
diry += -10+((ball._y-you._y)/4);
}
}
when i got to this t had some problems
Scene=Scene 1, Layer=Layer 1, Frame=1: Line 35: Syntax error.
}
yeah seemed simple enough but if i solved that more problems came up and if i gnored it and finished the tutorial it wouldn't work plz tell me is there a problem with the tutorial or is it something i messed up?