I have a final project in codehs, where we have to make our own game. I decided to do a game like ping pong, where it hits the paddles and adds points. If you touch the top or the bottom of the screen, you die and it restarts. I need help with adding points, and having it have the “you win”! Screen and restarting the points and positioning the ball in the middle of the screen. Any help would be deeply appreciated. Here’s the code I have :
var PADDLE_WIDTH = 80;
var PADDLE_HEIGHT = 15;
var PADDLE_OFFSET = 10;
var paddle;
var paddle2;
var setPosition;
var rectangle;

var Score;
var point = 0


var setPosition;

var txt = new Text("Can't touch the top or bottom. Get to 20!", "9pt Arial");

var BALL_RADIUS = 15;
var ball;
var dx = 4;
var dy = 4;


function start(){
drawBALL(BALL_RADIUS, Color.black, getWidth()/2, getHeight()/2);
mouseMoveMethod(yay);
paddle = new Rectangle(PADDLE_WIDTH, PADDLE_HEIGHT);
paddle.setPosition(100, 100);
mouseMoveMethod(yay);

Score = new Text("Score : ");
Score.setPosition(0, 35);
add(Score);

txt.setPosition(3, 15 );
txt.setColor(Color.blue);
add(txt);

checkWalls();

paddle2 = new Rectangle(PADDLE_WIDTH, PADDLE_HEIGHT);
paddle2.setPosition(500, 100);
add(paddle2);
}



function drawBALL(BALL_RADIUS, color, x, y){
ball = new Circle (BALL_RADIUS);
ball.setPosition(200, 200);
add(ball);
setTimer(draw, 0);
}

function draw(){
checkWalls();
ball.move(dx, dy);
}



function pop(e){
Score.setText("Score:" + point);

}





function checkWalls(){
if(ball.getX() + ball.getRadius() > getWidth()){
dx = -dx;
if (elem != null) {
dy = -dy;
}
}

if(ball.getX() - ball.getRadius() < 0){
dx = -dx;
if (elem != null) {
dy = -dy;
}
}

if(ball.getY() + ball.getRadius() > getHeight()){
dy = -dy;
if (elem != null) {
dy = -dy;
point = point - 1;
pop();
}

} if(ball.getY() - ball.getRadius() < 0){
dy = -dy;
if (elem != null) {
dy = -dy;
point = point - 1;
pop();
}
}
var elem = getElementAt(ball.getX(), ball.getY() - ball.getRadius());
if (elem != null) {
dy = -dy;
}
elem = getElementAt(ball.getX(), ball.getY() + ball.getRadius());
if (elem != null) {
dy = -dy;
}
}




function yay(e){
paddle.setPosition(e.getX(), getHeight() - 25);
paddle.setColor("#c48ed4");
add (paddle);
paddle2.setPosition(e.getX(), getHeight() - 430);
paddle2.setColor("#c48ed4");
add (paddle2);
}

I have a final project in codehs where we have to make our own game I decided to do a game like ping pong where it hits the paddles and adds points If you touch class=