Hey all,
I was playing around with a big patch of code that I read about before in one of the other threads here. It basically made it so that a movie clip bounces back when it collides with the boundaries of the movie.

Here is the complete code:

code:
onClipEvent (load) {
// when the clip loads, give it the folloing properties
speedX = 15;
// horizontal speed
speedY = 15;
// vertical speed
score1 = 0;
// score for player 1 is 0
score2 = 0;
// score for player 2 is 0
}
onClipEvent (enterFrame) {
// when a new frame is reached ...
// remeber that the x-axis is horizontal
this._X += speedX;
// give it horizontal velocity X
this._y += speedY;
// give it vertical velocity Y
if (this._X>=485) {
// if the mc reg point is at or equal to 485
speedX = -speedX;
// reverse velocity X
} else if (this._X<=15) {
// else if mc reg is at or equal to 15
speedX = -speedX;
// reverse velocity X
}
// remeber that the y-axis is vertical
if (this._Y>=285) {
// if mc reg is at or equal to 285
speedY = -speedY;
// reverse velocity Y
} else if (this._Y<=15) {
// else if mc reg is at or equal to 15
speedY = -speedY;
// reverse velocity Y
}
}



Now I am using a circle for my movie clip, and I was wondering why it always starts by moving in the same direction. I don't see any part of the code that specifies what angle it would start moving...

Any help would be great,
Thanks.