I’ve got a basic version of pong up and running, but I can’t figure out how to reset the ball back to it’s original speed every time a point is scored, also i can’t seem to increase the computer opponent lag to make the game possible to win. Anyhelp would be greatly appreciated.

Mouse.hide();

bounce = 1

vx = Math.random()*5+2;

vy = Math.random()*5+2;

top = 0;

bottom = 300;

left = 0;

right = 500;

playerscore = 0;

computerscore = 0;

ball.onEnterFrame = ballMove;

playerpaddle.onEnterFrame = playerMove;

computerpaddle.onEnterFrame = computerMove;

function ballMove() {

this._x += vx;

this._y += vy;

if (this._y<top) {

this._y = top;

vy *= -bounce;

}

if (this._y>bottom) {

this._y = bottom;

vy *= -bounce;

}

if (this._x<left) {

this._x = left;

vx *= -bounce;

}

if (this._x>right) {

this._x = right;

vx *= -bounce;

}

if (this.hitTest(playerpaddle)) {

vx *= -bounce;

vy *= -bounce;

}

if (this.hitTest(computerpaddle)) {

vx *= -bounce;

vy *= -bounce;

}

if (this._x<=5) {

this._x = 250;

this._y = 150;

playerscore++;

}

if (this._x>=495) {

this._x = 250;

this._y = 150;

computerscore++;

}

}

function playerMove() {

this._y = _ymouse;

}

function computerMove() {

this._y = ball._y;

}