diff --git a/Data/Buildings.json b/Data/Buildings.json index 90ed7f5..2bd562e 100644 --- a/Data/Buildings.json +++ b/Data/Buildings.json @@ -37,8 +37,8 @@ "allowedRotations": [0], "layer": 0 }, - "stone_iron": { - "scene": "res://Scenes/Tiles/StoneIronTile.tscn", + "ore_iron": { + "scene": "res://Scenes/Tiles/OreIronTile.tscn", "cost": {}, "durability": 200, "buildTime": 0.0, diff --git a/Scenes/Entities/Player.tscn b/Scenes/Entities/Player.tscn index 06932c0..a0f71f8 100644 --- a/Scenes/Entities/Player.tscn +++ b/Scenes/Entities/Player.tscn @@ -5,6 +5,7 @@ [node name="Player" type="CharacterBody2D"] script = ExtResource("1_08t41") +MaxZoom = 5.0 [node name="Sprite2D" type="Sprite2D" parent="."] rotation = 1.5708 diff --git a/Scenes/Tiles/GroundTile.png b/Scenes/Tiles/GroundTile.png index fc6c626..652991b 100644 Binary files a/Scenes/Tiles/GroundTile.png and b/Scenes/Tiles/GroundTile.png differ diff --git a/Scenes/Tiles/OreIronTile.png b/Scenes/Tiles/OreIronTile.png new file mode 100644 index 0000000..6905be1 Binary files /dev/null and b/Scenes/Tiles/OreIronTile.png differ diff --git a/Scenes/Tiles/StoneIronTile.png.import b/Scenes/Tiles/OreIronTile.png.import similarity index 70% rename from Scenes/Tiles/StoneIronTile.png.import rename to Scenes/Tiles/OreIronTile.png.import index 946df76..63e611f 100644 --- a/Scenes/Tiles/StoneIronTile.png.import +++ b/Scenes/Tiles/OreIronTile.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://c3qdue55e6blv" -path="res://.godot/imported/StoneIronTile.png-a3d6be6bb8b8b8a0f32242e23f1c00ca.ctex" +path="res://.godot/imported/OreIronTile.png-68726be1be21a3f84cf7d705e1a39b0d.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://Scenes/Tiles/StoneIronTile.png" -dest_files=["res://.godot/imported/StoneIronTile.png-a3d6be6bb8b8b8a0f32242e23f1c00ca.ctex"] +source_file="res://Scenes/Tiles/OreIronTile.png" +dest_files=["res://.godot/imported/OreIronTile.png-68726be1be21a3f84cf7d705e1a39b0d.ctex"] [params] diff --git a/Scenes/Tiles/StoneIronTile.tscn b/Scenes/Tiles/OreIronTile.tscn similarity index 67% rename from Scenes/Tiles/StoneIronTile.tscn rename to Scenes/Tiles/OreIronTile.tscn index 7d8edc9..e2d6e63 100644 --- a/Scenes/Tiles/StoneIronTile.tscn +++ b/Scenes/Tiles/OreIronTile.tscn @@ -1,24 +1,26 @@ [gd_scene load_steps=4 format=3 uid="uid://dnkcl5ucmip40"] -[ext_resource type="Script" uid="uid://dh0jdeplrigxu" path="res://Scripts/Tiles/GroundTile.cs" id="1_ewklp"] -[ext_resource type="Texture2D" uid="uid://c3qdue55e6blv" path="res://Scenes/Tiles/StoneIronTile.png" id="2_ewklp"] +[ext_resource type="Script" uid="uid://dh0jdeplrigxu" path="res://Scripts/Tiles/GroundTile.cs" id="1_exnim"] +[ext_resource type="Texture2D" uid="uid://c3qdue55e6blv" path="res://Scenes/Tiles/OreIronTile.png" id="2_7v0w1"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_8o613"] size = Vector2(54, 54) -[node name="StoneIronTile" type="StaticBody2D"] +[node name="OreIronTile" type="StaticBody2D"] collision_layer = 0 -script = ExtResource("1_ewklp") +script = ExtResource("1_exnim") TileId = "stone_iron" [node name="Sprite2D" type="Sprite2D" parent="."] -scale = Vector2(0.1, 0.1) -texture = ExtResource("2_ewklp") +position = Vector2(1.49012e-08, -9.53674e-07) +scale = Vector2(0.0983607, 0.0981818) +texture = ExtResource("2_7v0w1") [node name="CollisionShape2D" type="CollisionShape2D" parent="."] shape = SubResource("RectangleShape2D_8o613") [node name="ProgressOverlay" type="ColorRect" parent="."] +visible = false offset_left = -27.0 offset_top = -27.0 offset_right = 27.0 diff --git a/Scenes/Tiles/StoneIronTile.png b/Scenes/Tiles/StoneIronTile.png deleted file mode 100644 index 8af9e68..0000000 Binary files a/Scenes/Tiles/StoneIronTile.png and /dev/null differ diff --git a/Scenes/Tiles/StoneTile.png b/Scenes/Tiles/StoneTile.png index 6abfe0c..034a4f1 100644 Binary files a/Scenes/Tiles/StoneTile.png and b/Scenes/Tiles/StoneTile.png differ diff --git a/Scenes/Tiles/StoneTile.tscn b/Scenes/Tiles/StoneTile.tscn index 0286dfd..8cc06ec 100644 --- a/Scenes/Tiles/StoneTile.tscn +++ b/Scenes/Tiles/StoneTile.tscn @@ -12,13 +12,15 @@ script = ExtResource("1_rndy8") TileId = "stone" [node name="Sprite2D" type="Sprite2D" parent="."] -scale = Vector2(0.1, 0.1) +position = Vector2(1.01328e-06, 1.01328e-06) +scale = Vector2(0.0976562, 0.0976562) texture = ExtResource("2_rndy8") [node name="CollisionShape2D" type="CollisionShape2D" parent="."] shape = SubResource("RectangleShape2D_8o613") [node name="ProgressOverlay" type="ColorRect" parent="."] +visible = false offset_left = -27.0 offset_top = -27.0 offset_right = 27.0 diff --git a/Scripts/System/NaturalResourceGenerator.cs b/Scripts/System/NaturalResourceGenerator.cs index 96df218..f9260eb 100644 --- a/Scripts/System/NaturalResourceGenerator.cs +++ b/Scripts/System/NaturalResourceGenerator.cs @@ -71,7 +71,7 @@ public partial class NaturalResourceGenerator : Node2D if (_rng.Randf() < IronDensity) { var veinSize = _rng.RandiRange(MinIronVeinSize, MaxIronVeinSize); - PlaceVein(stoneCell, "stone_iron", veinSize, _ironTiles); + PlaceVein(stoneCell, "ore_iron", veinSize, _ironTiles); } } } @@ -93,10 +93,10 @@ public partial class NaturalResourceGenerator : Node2D switch (tileType) { // For iron, make sure we're placing on stone - case "stone_iron" when !_stoneTiles.Contains(cell): + case "ore_iron" when !_stoneTiles.Contains(cell): continue; // Remove from previous layer if needed - case "stone_iron" when _stoneTiles.Contains(cell): + case "ore_iron" when _stoneTiles.Contains(cell): _stoneTiles.Remove(cell); break; case "stone" when _groundTiles.Contains(cell): diff --git a/Scripts/Tiles/BaseTile.cs b/Scripts/Tiles/BaseTile.cs index 50fc438..985b666 100644 --- a/Scripts/Tiles/BaseTile.cs +++ b/Scripts/Tiles/BaseTile.cs @@ -8,8 +8,6 @@ namespace AceFieldNewHorizon.Scripts.Tiles; public partial class BaseTile : Node2D { [Export] public string TileId { get; set; } - - public BuildingData TileData { get; set; } private CollisionShape2D _collisionShape; private Sprite2D _sprite; diff --git a/Scripts/Tiles/GroundTile.cs b/Scripts/Tiles/GroundTile.cs index 10a3013..b27233f 100644 --- a/Scripts/Tiles/GroundTile.cs +++ b/Scripts/Tiles/GroundTile.cs @@ -4,5 +4,11 @@ namespace AceFieldNewHorizon.Scripts.Tiles; public partial class GroundTile : BaseTile { - + public override void _Ready() + { + var sprite = GetNode("Sprite2D"); + sprite.Modulate = new Color(0.75f, 0.75f, 0.75f); // Makes the sprite 25% darker + + base._Ready(); + } }