A
aristhemage
Guest
Hello, I have a create code that goes as follows:
I want it so that the trees don't spawn right next to each other (I'd prefer them to be at least 4-ish blocks apart)
and I have spammed R (debug thing to restart room) about 500 times, so I know it's not luck.
What should i do?
GML:
var wait = 0
for (var i = 0; i < 80; i++){
var number = irandom_range(0,5);
var number2 = irandom_range(0,1);
if wait = 0 {
if number = 2{
//Tree One
if number2 = 1{
world[worldArrayLength++] = instance_create_layer(i * 64, 704, "Blocks", block_log);
world[worldArrayLength++] = instance_create_layer(i * 64, 640, "Blocks", block_log);
world[worldArrayLength++] = instance_create_layer(i * 64, 576, "Blocks", block_log);
world[worldArrayLength++] = instance_create_layer(i * 64, 512, "Blocks", block_log);
world[worldArrayLength++] = instance_create_layer(i * 64 - 64, 512, "Blocks", block_leaves);
world[worldArrayLength++] = instance_create_layer(i * 64 + 64, 512, "Blocks", block_leaves);
world[worldArrayLength++] = instance_create_layer(i * 64 - 128, 448, "Blocks", block_leaves);
world[worldArrayLength++] = instance_create_layer(i * 64 - 64, 448, "Blocks", block_leaves);world[worldArrayLength++] = instance_create_layer(i * 64, 448, "Blocks", block_leaves);
world[worldArrayLength++] = instance_create_layer(i * 64 +64, 448, "Blocks", block_leaves);
world[worldArrayLength++] = instance_create_layer(i * 64 +128, 448, "Blocks", block_leaves);
world[worldArrayLength++] = instance_create_layer(i * 64 +64, 384, "Blocks", block_leaves);
world[worldArrayLength++] = instance_create_layer(i * 64 , 384, "Blocks", block_leaves);
world[worldArrayLength++] = instance_create_layer(i * 64 -64, 384, "Blocks", block_leaves);
world[worldArrayLength++] = instance_create_layer(i * 64 , 320, "Blocks", block_leaves);
}
wait++;
if wait >= 1{
var number3 = irandom_range(0,3)
if number3 = 3
{
wait++
}
if wait = 2
{
wait = 0;
}
}
}
}
and I have spammed R (debug thing to restart room) about 500 times, so I know it's not luck.
What should i do?