I made a game in which a ball moves randomly and if the player presses a ball he gains some points, I want if he does not press the ball he loses some points

I made a game in which a ball moves randomly and if the player presses a ball he gains some points, I want if he does not press the ball he loses some points (if he presses the background of the game without pressing any ball) what is the script and where is it supposed to be

Hello aziziz,
I’m a beginner myself but can say with confidence that you only need to watch some basic tutorials on how to get started with Unity to accomplish what you trying to do.

This is only about basic math operators + and - and calculate them with a variable. For checking where you clicked you need to get into Colliders as triggers or simpler only buttons as well as Raycasting.

Look this up and you can code this easily.