Hello,
im new in Defold (and programming too). I’m searching for a way to randomly spawn objects (such as enemies for example) on the map without overlapping other objects (like other enemies or the player).
Is it maybe possible to check the randomly generated x/y coordinates are taken by other objects before “factoring” a new object on it?
My idea was to place first randomly an invisible blank image on the map, then check for collisions. If there is a collision, remove it. If there is now collision, replace it with the real object.
I think this could work, but maybe someone can tell me a better / easer way to handle this.
Greetings from Germany
Dirk