diff --git a/Mine2d/game/backend/interactor/Breaking.cs b/Mine2d/game/backend/interactor/Breaking.cs index 381c3cb..5673bfe 100644 --- a/Mine2d/game/backend/interactor/Breaking.cs +++ b/Mine2d/game/backend/interactor/Breaking.cs @@ -83,7 +83,7 @@ public class Breaking } [Interaction(InteractorKind.Server, PacketType.BlockBroken)] - public static void BreakServer(BlockBrokenPacket packet) + public static void BlockBrokenServer(BlockBrokenPacket packet) { var ctx = Context.Get(); var tile = ctx.TileRegistry.GetTile(packet.Tile.Id); diff --git a/Mine2d/game/core/world/ChunkGenerator.cs b/Mine2d/game/core/world/ChunkGenerator.cs index 5b76aea..439c1c2 100644 --- a/Mine2d/game/core/world/ChunkGenerator.cs +++ b/Mine2d/game/core/world/ChunkGenerator.cs @@ -33,8 +33,8 @@ public class ChunkGenerator { for (var j = 0; j < Constants.ChunkSize; j++) { - var n = (Noise.coherentNoise(i + (x * 32), j + (y * 32), 0, 1, 25, 0.5f, 0.9f)); - var n2 = (Noise2.coherentNoise(i + (x * 32), j + (y * 32), 0, 1, 25, 0.5f, 0.9f)); + var n = Noise.coherentNoise((int)((i + (x * 32)) * 0.6), (int)((j + (y * 32)) * 1), 0, 1, 25, 0.5f, 0.9f); + var n2 = Noise2.coherentNoise((int)((i + (x * 32)) * 0.6), (int)((j + (y * 32)) * 1), 0, 1, 25, 0.5f, 0.9f); // Console.WriteLine(i * (x * 32) + " "+ j * (y * 32)); if (n > 0.08 || n2 > 0.08) continue; chunk.SetTile(i, j, fill); @@ -69,6 +69,26 @@ public class ChunkGenerator { fill.Id = (int)Tiles.CoalOre; } + if (fill.Id != 1) + { + var pX = i; + var pY = j; + var maxCount = new Random().NextInt64(fill.Id == (int)Tiles.CoalOre ? 3 : 1, fill.Id == (int)Tiles.CoalOre ? 10 : 6); + for (var count = 0; count < maxCount; count++) + { + var delta = new Random().NextInt64(-1, 2); + var dir = new Random().NextInt64(0, 2); + pX += (int)(dir == 0 ? delta : 0); + pY += (int)(dir == 1 ? delta : 0); + Console.WriteLine("Try Adding ader"); + Console.WriteLine(pX + " " + pY); + if (chunk.HasTile(pX, pY)) + { + chunk.SetTile(pX, pY, STile.From(fill.Id)); + Console.WriteLine("Adding ader"); + } + } + } chunk.SetTile(i, j, fill); } } diff --git a/Mine2d/game/core/world/WorldGenerator.cs b/Mine2d/game/core/world/WorldGenerator.cs index 5a3807b..2d898d8 100644 --- a/Mine2d/game/core/world/WorldGenerator.cs +++ b/Mine2d/game/core/world/WorldGenerator.cs @@ -101,7 +101,7 @@ public class WorldGenerator } } - var rng = random.Next(0, 700); + var rng = random.Next(0, 1050); if (rng < ores.Count) { return ores[rng]; diff --git a/Mine2d/game/frontend/renderer/WorldRenderer.cs b/Mine2d/game/frontend/renderer/WorldRenderer.cs index fef901e..4dc0867 100644 --- a/Mine2d/game/frontend/renderer/WorldRenderer.cs +++ b/Mine2d/game/frontend/renderer/WorldRenderer.cs @@ -88,7 +88,7 @@ public class WorldRenderer : IRenderer { ctx.Renderer.DrawText("" + Math.Round(ChunkGenerator.Noise.coherentNoise( (chunk.X * Constants.ChunkSize) + x, - (chunk.Y * Constants.ChunkSize) + y, + (int)(((chunk.Y * Constants.ChunkSize) + y)*0.7), 0 ), 4), (drawX - (int)camera.Position.X) * scale,