Hello,
I am trying to write a program where there are 3 apples in a tree. When you click on an apple, it will fall until it hits the ground and when you press any key, the scene will restart. Every time the apples will appear on a random place and must remain inside the green area of the tree. I have been able to do all of that successfully with ONE apple. However, I cannot get the code to work when I try to add more apples. Is there a way I can do this without having to use multiple x, y, and dy variables?
Here is my code:
1