Exemple #1
0
// This can help you figure out the angle of a surface if you sample 2 spots
global func GetYBorder(int x, int y, int stepping) {
	if (GBackSolid(x,y)) {
		return GetYFree(x, y, -stepping);
	} else {
		return GetYSolid(x, y, stepping);
	}
}
Exemple #2
0
func findSpawnPoint(miny) {
	var x,y;
	
	while (true) {
		x = 20 + Random(LandscapeWidth() - 40);
		y = miny;
		
		while (GBackSolid(x, y) && y < LandscapeHeight()) {
			y++;
		}
		y = GetYSolid(x, y);
		
		if (LandscapeHeight() - y < 10) continue;
		if (FindObject2(Find_InRect(x-30, y - 80, 60, 160), Find_Category (C4D_Structure))) continue;
		if (GBackLiquid(x, y-3)) continue;
		
		return [x,y];
	}
	return [];
}