Posted 22 November 2018 - 05:21 AM
What if you wanted to spawn 2 trees? but, you don't want to have the trees to spawn
in the exact same spot. So you mark the 1st tree in a way to 1. ID the tree 2.
get the coordinates of that tree, you do this because you want to be able to pull
up the ID, check if the ID's coordinates are matching the same coordinates your
putting in for the tree your currently making, (the 2nd tree) and if they match
then you want to change those coordinates until they do not match the 1st Tree's
coordinates. Now the actual goal is to spawn a large number of trees to the point
where you wouldn't want to make this code by hand but more like a repeatable code
that goes on until you get the desired amount maybe 10, 20, or 200 who knows.
How would you organize this in a way to do that? keeping in mind that each tree
needs its own coordinates and ID.
Now I know to some of you this will most likely seem to be very easy to do but for
some reason I'm struggling to comprehend it so it would help if when you respond explain it
in a simple way to where a child would understand that's all and thank you for your time.
P.S. If the Trees separation could be a random distance apart that would also be ideal.
in the exact same spot. So you mark the 1st tree in a way to 1. ID the tree 2.
get the coordinates of that tree, you do this because you want to be able to pull
up the ID, check if the ID's coordinates are matching the same coordinates your
putting in for the tree your currently making, (the 2nd tree) and if they match
then you want to change those coordinates until they do not match the 1st Tree's
coordinates. Now the actual goal is to spawn a large number of trees to the point
where you wouldn't want to make this code by hand but more like a repeatable code
that goes on until you get the desired amount maybe 10, 20, or 200 who knows.
How would you organize this in a way to do that? keeping in mind that each tree
needs its own coordinates and ID.
Now I know to some of you this will most likely seem to be very easy to do but for
some reason I'm struggling to comprehend it so it would help if when you respond explain it
in a simple way to where a child would understand that's all and thank you for your time.
P.S. If the Trees separation could be a random distance apart that would also be ideal.
Edited on 02 December 2018 - 06:10 AM