Ok now I have another question.
I set some objects to spawn in random positions on the screen, but there is a problem.
Sometimes some of them spawn on top of each other (because they spawn at a random location,and sometimes that random location is on top of another object)
Can I make them spawn in random positions, but prevent them from spawning on top of other objects?
You need to choose random x,y values then check if they coincide with existing object positions, in which case, try again. In other words, write some code to do it.