# Maerron

Member Since 03 Oct 2009
Offline Last Active Today, 02:21 PM

### In Topic: Cut string

01 April 2012 - 04:07 AM

### In Topic: Help with for loop

31 March 2012 - 04:17 PM

Are you trying to change an instance into plan1 and place them in the middle of the rectangle if there is plan1 in the rectangle?
I think the position should be:
```x = x1+60/2
y = y1+100/2```

### In Topic: Help with for loop

30 March 2012 - 04:19 PM

Do you use array to store information about the whether the rectangles contain plants or not? Or simply by checking collision?

If you use 2D array:
```d1 = (x1-40)/80;
d2 = (y1-80)/100;
array[d1,d2]
```

### In Topic: Help with for loop

28 March 2012 - 05:42 PM

Probably this is what you want?
```var x1, y1, ;
for (y1 = 80; y1 <= 480; y1 += 100)
{for (x1 = 40; x1 <= 520; x1 += 80)
{if (point_in_rectangle(x1,y1,x1+60,y1+100))
{;}
}
}
```

### In Topic: Line Line Intersection

23 March 2012 - 05:16 AM

Good script, used to solve my critical problem . Though I just combined the script into one and modified them to check the denominator first to prevent 'divide by zero' error.