player and entity physics improvements

This commit is contained in:
2025-10-01 00:40:47 +02:00
parent 11f76ca429
commit bd2c87ddd1
7 changed files with 444 additions and 105 deletions

View File

@@ -15,14 +15,11 @@ namespace Voxel
private static float amplitude1 = 4;
private static float amplitude2 = 2;
private static float mountainMapRes = (float)1/2;
private static float mountainMapAmplitude = 8;
private static float elevationMapRes = (float)1/8;
private static float elevationMapAmplitude = 32;
private static FastNoiseLite noise = new FastNoiseLite();
private static Random random = new Random();
private static FastNoiseLite noise = new FastNoiseLite(random.Next());
public static int GetHeight(int x, int z)
{
@@ -35,16 +32,11 @@ namespace Voxel
z * res2
) * amplitude2;
float mountainMap = noise.GetNoise(
x * mountainMapRes,
z * mountainMapRes
) * mountainMapAmplitude;
float elevationMap = (noise.GetNoise(
x * elevationMapRes,
z * elevationMapRes
) + 0.25f) * elevationMapAmplitude;
return baseHeight + (int)(elevationMap + ((map1 + map2) * 1 + mountainMap));
return baseHeight + (int)(elevationMap + map1 + map2);
}
public static Blocks GetBlock(int y, int maxY)