#2 Collects resources

#8 Generates resources based on resource data
#10 Shows total resources and adjusts for new resources
This commit is contained in:
2024-02-07 09:22:14 -06:00
parent 7c81a2229e
commit 84de7fa6f1
10 changed files with 157 additions and 39 deletions

View File

@@ -1,21 +1,17 @@
[gd_scene load_steps=8 format=3 uid="uid://m0us5xqa3gnk"]
[gd_scene load_steps=9 format=3 uid="uid://m0us5xqa3gnk"]
[ext_resource type="Script" path="res://scripts/world.gd" id="1_yf6q1"]
[ext_resource type="Resource" uid="uid://dr00rd4f42jqe" path="res://data/game_resources/gem_resource.tres" id="2_rn4a2"]
[ext_resource type="TileSet" uid="uid://d1sh6dy2w10b0" path="res://data/scifi_tileset.tres" id="2_sa7dm"]
[ext_resource type="Script" path="res://scripts/window.gd" id="3_bfjot"]
[ext_resource type="Resource" uid="uid://bpjj0x7jr1k6u" path="res://data/game_resources/carbon_resource.tres" id="3_pq6ic"]
[ext_resource type="Script" path="res://scripts/building_manager.gd" id="4_61js3"]
[ext_resource type="Texture2D" uid="uid://n806c03hgaq1" path="res://assets/scifi_tilesheet@2.png" id="5_qhth7"]
[sub_resource type="AtlasTexture" id="AtlasTexture_m3qlj"]
atlas = ExtResource("5_qhth7")
region = Rect2(640, 768, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_oqxqp"]
atlas = ExtResource("5_qhth7")
region = Rect2(640, 384, 128, 128)
[ext_resource type="Script" path="res://scripts/resource_manager.gd" id="5_k5643"]
[ext_resource type="Script" path="res://scripts/gui.gd" id="6_yuatk"]
[node name="world" type="Node2D"]
script = ExtResource("1_yf6q1")
game_resources = Array[Resource("res://scripts/game_resource.gd")]([ExtResource("2_rn4a2"), ExtResource("3_pq6ic")])
[node name="world_grid" type="TileMap" parent="."]
tile_set = ExtResource("2_sa7dm")
@@ -39,6 +35,13 @@ script = ExtResource("3_bfjot")
[node name="BuildingManager" type="Node2D" parent="."]
script = ExtResource("4_61js3")
[node name="ResourceManager" type="Node2D" parent="."]
script = ExtResource("5_k5643")
[node name="Timer" type="Timer" parent="ResourceManager"]
wait_time = 5.0
autostart = true
[node name="CanvasLayer" type="CanvasLayer" parent="."]
[node name="GUI" type="Control" parent="CanvasLayer"]
@@ -49,6 +52,7 @@ anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 1
script = ExtResource("6_yuatk")
[node name="ResourceContainer" type="PanelContainer" parent="CanvasLayer/GUI"]
layout_mode = 1
@@ -59,24 +63,18 @@ offset_left = -128.0
offset_bottom = 128.0
grow_horizontal = 0
[node name="GridContainer" type="GridContainer" parent="CanvasLayer/GUI/ResourceContainer"]
[node name="VBoxContainer" type="VBoxContainer" parent="CanvasLayer/GUI/ResourceContainer"]
layout_mode = 2
[node name="ResourcesLabel" type="Label" parent="CanvasLayer/GUI/ResourceContainer/VBoxContainer"]
layout_mode = 2
size_flags_stretch_ratio = 2.0
text = "Resources:"
horizontal_alignment = 1
[node name="GridContainer" type="GridContainer" parent="CanvasLayer/GUI/ResourceContainer/VBoxContainer"]
layout_mode = 2
columns = 2
[node name="GemTexture" type="TextureRect" parent="CanvasLayer/GUI/ResourceContainer/GridContainer"]
layout_mode = 2
texture = SubResource("AtlasTexture_m3qlj")
expand_mode = 3
[node name="GemLabel" type="Label" parent="CanvasLayer/GUI/ResourceContainer/GridContainer"]
layout_mode = 2
text = "100000"
[node name="CarbonTexture" type="TextureRect" parent="CanvasLayer/GUI/ResourceContainer/GridContainer"]
layout_mode = 2
texture = SubResource("AtlasTexture_oqxqp")
expand_mode = 3
[node name="CarbonLabel" type="Label" parent="CanvasLayer/GUI/ResourceContainer/GridContainer"]
layout_mode = 2
text = "100"
[connection signal="changed_resource" from="ResourceManager" to="CanvasLayer/GUI" method="_on_resource_manager_changed_resource"]
[connection signal="timeout" from="ResourceManager/Timer" to="ResourceManager" method="_on_timer_timeout"]