Ping Pong (Stuck on Scoring System)

Hi, I have created a Ping Pong game on Code Pen. It is impossible to beat the AI so I want to make the scoring system when the player hits the ball. Does anyone have any recommendation of how I can implement this? Thank you.

I think something in your collide() function, like a bool to keep track whether the ball collides with the Player or AI.

If it collides with the player then this.score++ else if it collides with the AI then this.ball.velocity++

1 Like

thanks man, Ill get onto that now. Appreciate it