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"] [ext_resource type="Script" path="res://scripts/Modules/Module.gd" id="1_42v8k"]
[node name="Node" type="Node"]
script = ExtResource("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"] [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", "base": "Module",
"class": &"Cannon", "class": &"Cannon",
"language": &"GDScript", "language": &"GDScript",
"path": "res://Cannon.gd" "path": "res://scripts/Modules/Cannon.gd"
}, { }, {
"base": "Node", "base": "Node",
"class": &"Module", "class": &"Module",
"language": &"GDScript", "language": &"GDScript",
"path": "res://Module.gd" "path": "res://scripts/Modules/Module.gd"
}, { }, {
"base": "Module", "base": "Module",
"class": &"Storage", "class": &"Storage",
"language": &"GDScript", "language": &"GDScript",
"path": "res://Storage.gd" "path": "res://scripts/Modules/Storage.gd"
}, { }, {
"base": "Module", "base": "Module",
"class": &"TrainEngine", "class": &"TrainEngine",
"language": &"GDScript", "language": &"GDScript",
"path": "res://Engine.gd" "path": "res://scripts/Modules/Engine.gd"
}] }]
_global_script_class_icons={ _global_script_class_icons={
"Cannon": "", "Cannon": "",

View File

@@ -7,7 +7,7 @@ enum STATE {INACTIVE, RELOADING, SHOOTING}
#------------Methods-------------# #------------Methods-------------#
func _ready(): func _ready():
var root = get_tree().root.get_child(0) var root = get_tree().root.get_child(0)
root.shooting.connect(_on_signal_shooting) root.shoot.connect(_on_signal_shooting)
maxStashValue = 1 maxStashValue = 1
currentStashValue = 0 currentStashValue = 0
currentState = STATE.INACTIVE currentState = STATE.INACTIVE
@@ -17,15 +17,16 @@ func interact():
#TODO: RELOADING #TODO: RELOADING
if currentStashValue < maxStashValue: if currentStashValue < maxStashValue:
currentState = STATE.RELOADING currentState = STATE.RELOADING
++currentStashValue currentStashValue += 1
return return
return return
func _on_signal_shooting(): func _on_signal_shooting():
print("hit")
if currentStashValue >= 1 and currentState == STATE.INACTIVE: if currentStashValue >= 1 and currentState == STATE.INACTIVE:
currentState = STATE.SHOOTING currentState = STATE.SHOOTING
--currentStashValue currentStashValue -= 1
#TODO: SHOOTING #TODO: SHOOTING
currentState = STATE.INACTIVE currentState = STATE.INACTIVE
return return

View File

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

View File

@@ -9,15 +9,15 @@ enum TYPE {AMMO, GUNPOWDER, FUEL}
#------------Methods-------------# #------------Methods-------------#
func _ready(): func _ready():
var root = get_tree().root.get_child(0) var root = get_tree().root.get_child(0)
root.shooting.connect(_on_signal_storing) root.ammo_pickup.connect(_on_signal_storing)
maxStashValue = 5 maxStashValue = 5
currentStashValue = 0 currentStashValue = 0
func interact(): func interact():
if currentStashValue >= 1: if currentStashValue >= 1:
--currentStashValue currentStashValue -= 1
return return
func _on_signal_storing(): func _on_signal_storing():
if currentStashValue < maxStashValue: if currentStashValue < maxStashValue:
++currentStashValue currentStashValue += 1
return return