By looking at this image I think you will understand my problem pretty well:
(image removed - url no longer valid, returns advertising now)
So basically I want a function that takes an object as parameter and gives this object the correct coordinates based on how many objects I've added before.
Let's say I would add all these objects to an array:
objectArray[]
Each time I add a new object:
objectArray.add(object)
The object.x
and object.y
coordinates will be set based on some algorithm:
object.x = ?
object.y = ?
(I'm working in Java)
Thanks for any help.