// pick a random spawnpoint
Iterator<Spawnpoint> it = world.getMap().getSpawnpointCollection().iterator();
for (int i = 0; i < ((int)Math.random() * world.getMap().getSpawnpointCollection().size() -1); i++) {
it.next();
}
Spawnpoint spawn = it.next();
int radius = spawn.getRadius();
// pick a random position in a certain radius
float t = (float)(2 * Math.PI * Math.random());
float r = (float)(radius * -1 + (Math.random() * radius));
WorldPosition pos = new WorldPosition(
(float)(spawn.getX() + (r * Math.cos(t))),
(float)(spawn.getY() + (r * Math.sin(t))),
spawn.getPlane());
return pos;
}