Merge branch 'main' of github.com:PfandBoss/SemesterGameJam2022

This commit is contained in:
2022-12-10 03:31:48 +01:00
10 changed files with 27 additions and 23 deletions

View File

@@ -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"]

6
Nodes/cannon.tscn Normal file
View File

@@ -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")

View File

@@ -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"]

7
Storage.tscn Normal file
View File

@@ -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

View File

@@ -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")

View File

@@ -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": "",

View File

@@ -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

View File

@@ -17,7 +17,6 @@ func interact():
currentStashValue += 10
if currentStashValue > maxStashValue:
currentStashValue = maxStashValue
return
#TODO: Repair Train
currentState = STATE.RUNNING

View File

@@ -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