diff --git a/Module.tscn b/Module.tscn index ac2c192..fb3efd7 100644 --- a/Module.tscn +++ b/Module.tscn @@ -1,6 +1,3 @@ -[gd_scene load_steps=2 format=3 uid="uid://b87b68ghm4dkk"] +[gd_scene load_steps=2 format=3] -[ext_resource type="Script" path="res://Module.gd" id="1_42v8k"] - -[node name="Node" type="Node"] -script = ExtResource("1_42v8k") +[ext_resource type="Script" path="res://scripts/Modules/Module.gd" id="1_42v8k"] diff --git a/Nodes/cannon.tscn b/Nodes/cannon.tscn new file mode 100644 index 0000000..6782155 --- /dev/null +++ b/Nodes/cannon.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=3 uid="uid://kupfq75m0v37"] + +[ext_resource type="Script" path="res://scripts/Modules/Cannon.gd" id="1_vdn0s"] + +[node name="Cannon" type="Node"] +script = ExtResource("1_vdn0s") diff --git a/Nodes/game.tscn b/Nodes/game.tscn index 5fdcbeb..8bf6463 100644 --- a/Nodes/game.tscn +++ b/Nodes/game.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=5 format=3 uid="uid://n7w0ff7u25yc"] +[gd_scene load_steps=5 format=3 uid="uid://bl1yrgr7g06db"] [ext_resource type="Script" path="res://scripts/Logic/Game.gd" id="1_iox18"] diff --git a/Storage.tscn b/Storage.tscn new file mode 100644 index 0000000..ae3b755 --- /dev/null +++ b/Storage.tscn @@ -0,0 +1,7 @@ +[gd_scene load_steps=2 format=3 uid="uid://1sr52olklfyy"] + +[ext_resource type="Script" path="res://scripts/Modules/Storage.gd" id="1_guwoh"] + +[node name="Storage" type="Node"] +script = ExtResource("1_guwoh") +currentType = 0 diff --git a/cannon.tscn b/cannon.tscn deleted file mode 100644 index 4c528ea..0000000 --- a/cannon.tscn +++ /dev/null @@ -1,6 +0,0 @@ -[gd_scene load_steps=2 format=3 uid="uid://d2g0of2prwwj4"] - -[ext_resource type="Script" path="res://Cannon.gd" id="1_mopo1"] - -[node name="Cannon" type="Node"] -script = ExtResource("1_mopo1") diff --git a/project.godot b/project.godot index e5b82ea..0e16438 100644 --- a/project.godot +++ b/project.godot @@ -12,22 +12,22 @@ _global_script_classes=[{ "base": "Module", "class": &"Cannon", "language": &"GDScript", -"path": "res://Cannon.gd" +"path": "res://scripts/Modules/Cannon.gd" }, { "base": "Node", "class": &"Module", "language": &"GDScript", -"path": "res://Module.gd" +"path": "res://scripts/Modules/Module.gd" }, { "base": "Module", "class": &"Storage", "language": &"GDScript", -"path": "res://Storage.gd" +"path": "res://scripts/Modules/Storage.gd" }, { "base": "Module", "class": &"TrainEngine", "language": &"GDScript", -"path": "res://Engine.gd" +"path": "res://scripts/Modules/Engine.gd" }] _global_script_class_icons={ "Cannon": "", diff --git a/Cannon.gd b/scripts/Modules/Cannon.gd similarity index 85% rename from Cannon.gd rename to scripts/Modules/Cannon.gd index 56a55e5..0cdf903 100644 --- a/Cannon.gd +++ b/scripts/Modules/Cannon.gd @@ -7,7 +7,7 @@ enum STATE {INACTIVE, RELOADING, SHOOTING} #------------Methods-------------# func _ready(): var root = get_tree().root.get_child(0) - root.shooting.connect(_on_signal_shooting) + root.shoot.connect(_on_signal_shooting) maxStashValue = 1 currentStashValue = 0 currentState = STATE.INACTIVE @@ -17,15 +17,16 @@ func interact(): #TODO: RELOADING if currentStashValue < maxStashValue: currentState = STATE.RELOADING - ++currentStashValue + currentStashValue += 1 return return func _on_signal_shooting(): + print("hit") if currentStashValue >= 1 and currentState == STATE.INACTIVE: currentState = STATE.SHOOTING - --currentStashValue + currentStashValue -= 1 #TODO: SHOOTING currentState = STATE.INACTIVE return diff --git a/Engine.gd b/scripts/Modules/Engine.gd similarity index 99% rename from Engine.gd rename to scripts/Modules/Engine.gd index 760d79e..58ac3e6 100644 --- a/Engine.gd +++ b/scripts/Modules/Engine.gd @@ -17,7 +17,6 @@ func interact(): currentStashValue += 10 if currentStashValue > maxStashValue: currentStashValue = maxStashValue - return #TODO: Repair Train currentState = STATE.RUNNING diff --git a/Module.gd b/scripts/Modules/Module.gd similarity index 100% rename from Module.gd rename to scripts/Modules/Module.gd diff --git a/Storage.gd b/scripts/Modules/Storage.gd similarity index 78% rename from Storage.gd rename to scripts/Modules/Storage.gd index 840cc53..baf1804 100644 --- a/Storage.gd +++ b/scripts/Modules/Storage.gd @@ -9,15 +9,15 @@ enum TYPE {AMMO, GUNPOWDER, FUEL} #------------Methods-------------# func _ready(): var root = get_tree().root.get_child(0) - root.shooting.connect(_on_signal_storing) + root.ammo_pickup.connect(_on_signal_storing) maxStashValue = 5 currentStashValue = 0 func interact(): if currentStashValue >= 1: - --currentStashValue + currentStashValue -= 1 return func _on_signal_storing(): if currentStashValue < maxStashValue: - ++currentStashValue + currentStashValue += 1 return