[mx]Problems with motion not reversing in Breakout game
Hi,
i have coded a very simple version of "Breakout" HERE
The whole thing works great bar one small problem.
I can't understand why the ball does not reverse it's _x/_y movement when it rebounds into a brick from another brick - Hit a brick from the bat - no problem, but get behind a brick & then hit that & the ball merrily carries on in it's original path.
fla attached.
Maybe try something like this...
Code:
for (i in thisOne) {
if (thisOne[i].hitTest(_root["ball" + h])) {
my_sound.start();
var dir = (_root.xMover < 0) ? 1 : -1;
_root.xMover = thisOne[i].xMove * dir;
points = points + (thisOne[i].how);
thisOne[i].removeMovieClip();
break;
}
}