@Yannici: Was, wenn dann aber schon alles voll ist da?
@Sinner:
Before I joined the TWLan Dev, I wrote a little script for myself and it looked similar to this:
Greetings
Molt
@Sinner:
Before I joined the TWLan Dev, I wrote a little script for myself and it looked similar to this:
PHP Code:
// Given variables:
// $direction = direction in which the village should be created
// $villages = amount of villages
// Coord-System is like in Tribalwars
// So, the main idea is to find a circle where the village is created on
$radius = sqrt($villages);
if($direction == "nw" || $direction == "sw")
{
$x = rand(0, -1);
}
else
{
$x = rand(0, 1);
}
// Now we have a horizontal value and need the vertical one
$y = cos(asin($x));
// But it will always be positive, so we have to make another check
if($direction == "se" || $direction == "sw")
{
$y *= (-1);
}
// All we have to do now is multiply x and y with the radius and add the center coords of the map
$x *= $radius;
$y *= $radius;
$x += 500;
$y += 500;
$x = round($x);
$y = round($y);
// And then of course check if this coords are free ;)
Greetings
Molt