Added resources to the game and prepared scripts for later usage

This commit is contained in:
=
2026-04-29 18:03:43 +02:00
parent 253c7d9f89
commit c54ff3088e
15 changed files with 102 additions and 56 deletions
+2 -1
View File
@@ -6,7 +6,6 @@ using static GameData;
public partial class World : Node3D
{
Random rand = new Random();
public Dictionary<string, MeshInstance3D> tileMeshes;
public Dictionary<string, MeshInstance3D> contentMeshes;
public Dictionary<string, List<Placeholder>> tilePlaceholders;
@@ -179,6 +178,8 @@ public partial class World : Node3D
posY = rand.Next(layerSize);
if (layer.tiles[posX, posY].containsResource) continue;
layer.tiles[posX, posY].containsResource = true;
layer.tiles[posX, posY].resource = new GameResource(ResourceDistributor.GetResource(layer.currentResources));
layer.currentResources.Add(layer.tiles[posX, posY].resource.name);
currentResource++;
}
}