Ping Pong (Stuck on Scoring System)

Ping Pong (Stuck on Scoring System)
0

#1

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.


#2

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++


#3

thanks man, Ill get onto that now. Appreciate it