hello fairly new to programming i need a code that " if at world edge add a certain amount of objects that get incremented but stay a good amount away from each other so they will not overlap" please help!!
if(atWorldEdge())
{
addObjecct(new Object(x,y);
addObjecct(new Object(x,y);
addObjecct(new Object(x,y);
setLocation(x,y);
}
this is a summary of what i have I'm very confused
... add a certain amount of objects that get incremented ...
Objects don't "get incremented". What do you mean by that? Also, where do you want the objects to be added - what are they for, or what do they represent?
And: we need to see more code than that. What are the x and y values you are using - where do they come from?
I believe he means he wants the actors to be added to the world at a fixed distance from eachother, but not overlapping.
This could be done by hard coding different values where x and y are that are far enough apart that the objects don't overlap. Unless you're feeling fancy, in which case a for() loop would be a better idea.