Dodanie kopani miedzi

This commit is contained in:
Tomasz Boruc 2025-11-03 23:28:31 +01:00
parent e96bf1693f
commit 3213088f9d
3 changed files with 25 additions and 8 deletions

View File

@ -36,11 +36,13 @@ vertical_alignment = 1
[node name="CanvasLayer" type="CanvasLayer" parent="."]
[node name="Info" type="Label" parent="CanvasLayer"]
visible = false
offset_left = 16.0
offset_top = 32.0
offset_right = 128.0
offset_bottom = 120.0
theme_override_font_sizes/font_size = 8
offset_right = 183.0
offset_bottom = 215.0
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 1
theme_override_fonts/font = ExtResource("3_ggt7d")
theme_override_font_sizes/font_size = 9
text = "test"
autowrap_mode = 2

View File

@ -2,7 +2,7 @@ extends Node
const BUILDINGS = {
"iron_mine": {
"name": "Kopalnia żelaza",
"name": "Iron Mine",
"description": "Pozwala wydobywać żelazo z powierzchni planety.",
"resource": "iron",
"cost": {"iron": 100, "carbon": 50},
@ -11,12 +11,21 @@ const BUILDINGS = {
"required_tech": null
},
"water_purifier": {
"name": "Oczyszczalnia wody",
"name": "Water Purifier",
"description": "Pozwala wydobywać i oczyszczać wodę do użytku kolonii.",
"resource": "water",
"cost": {"iron": 80, "carbon": 40},
"build_time": 8.0,
"texture": "res://assets/buildings/water_purifier.png",
"required_tech": null
},
"copper_mine": {
"name": "Kopalnia miedzi",
"description": "Pozwala wydobywać miedź.",
"resource": "copper",
"cost": {"iron": 80, "carbon": 40},
"build_time": 22.0,
"texture": "res://assets/buildings/water_purifier.png",
"required_tech": null
}
}

View File

@ -39,7 +39,7 @@ func _ready():
# Testowanie funkcji
add_building("iron_mine")
add_building("water_purifier")
add_building("iron_mine") # próba dodania ponownie
add_building("copper_mine") # próba dodania ponownie
print("Lista budynków na planecie:", buildings)
var data = BuildingsList.BUILDINGS["iron_mine"]
@ -104,7 +104,13 @@ func print_data():
var display_name = tr(key)
text += "%s: %.2f +(%s)\n" % [display_name, round(res.get("amount", 0) * 100) / 100.0, check_growth()]
# --- Budynki ---
if buildings.size() > 0:
text += "Budynki na planecie:\n"
for b in buildings:
var data = BuildingsList.BUILDINGS[b.id]
var status = "W budowie" if b.is_building else "Gotowy"
text += "- %s [%s]\n" % [data.name, status]
info_label.text = text