mirror of
https://github.com/PfandBoss/SemesterGameJam2022.git
synced 2025-11-12 12:16:14 +01:00
Leo - Train pickup function
This commit is contained in:
@@ -34,27 +34,27 @@ grow_horizontal = 2
|
|||||||
grow_vertical = 2
|
grow_vertical = 2
|
||||||
|
|
||||||
[node name="Start" type="Button" parent="VBoxContainer"]
|
[node name="Start" type="Button" parent="VBoxContainer"]
|
||||||
offset_right = 72.0
|
offset_right = 87.0
|
||||||
offset_bottom = 31.0
|
offset_bottom = 31.0
|
||||||
text = "Start
|
text = "Start
|
||||||
"
|
"
|
||||||
|
|
||||||
[node name="Tutorial" type="Button" parent="VBoxContainer"]
|
[node name="Tutorial" type="Button" parent="VBoxContainer"]
|
||||||
offset_top = 35.0
|
offset_top = 35.0
|
||||||
offset_right = 72.0
|
offset_right = 87.0
|
||||||
offset_bottom = 66.0
|
offset_bottom = 66.0
|
||||||
text = "Tutorial
|
text = "Tutorial
|
||||||
"
|
"
|
||||||
|
|
||||||
[node name="Settings" type="Button" parent="VBoxContainer"]
|
[node name="Settings" type="Button" parent="VBoxContainer"]
|
||||||
offset_top = 70.0
|
offset_top = 70.0
|
||||||
offset_right = 72.0
|
offset_right = 87.0
|
||||||
offset_bottom = 101.0
|
offset_bottom = 101.0
|
||||||
text = "Volume:"
|
text = "Volume:"
|
||||||
|
|
||||||
[node name="VolSlider" type="HSlider" parent="VBoxContainer"]
|
[node name="VolSlider" type="HSlider" parent="VBoxContainer"]
|
||||||
offset_top = 105.0
|
offset_top = 105.0
|
||||||
offset_right = 72.0
|
offset_right = 87.0
|
||||||
offset_bottom = 121.0
|
offset_bottom = 121.0
|
||||||
min_value = -30.0
|
min_value = -30.0
|
||||||
max_value = 0.0
|
max_value = 0.0
|
||||||
@@ -62,11 +62,14 @@ script = ExtResource("2_h85ei")
|
|||||||
|
|
||||||
[node name="Quit" type="Button" parent="VBoxContainer"]
|
[node name="Quit" type="Button" parent="VBoxContainer"]
|
||||||
offset_top = 125.0
|
offset_top = 125.0
|
||||||
offset_right = 72.0
|
offset_right = 87.0
|
||||||
offset_bottom = 156.0
|
offset_bottom = 156.0
|
||||||
text = "Quit"
|
text = "Quit"
|
||||||
|
|
||||||
[node name="FullScreen" type="Button" parent="VBoxContainer"]
|
[node name="FullScreen" type="Button" parent="VBoxContainer"]
|
||||||
|
offset_top = 160.0
|
||||||
|
offset_right = 87.0
|
||||||
|
offset_bottom = 191.0
|
||||||
text = "Fullscreen"
|
text = "Fullscreen"
|
||||||
|
|
||||||
[connection signal="pressed" from="VBoxContainer/Start" to="." method="_on_start_pressed"]
|
[connection signal="pressed" from="VBoxContainer/Start" to="." method="_on_start_pressed"]
|
||||||
|
|||||||
@@ -33,3 +33,15 @@ func is_dead():
|
|||||||
game_over.emit()
|
game_over.emit()
|
||||||
return true
|
return true
|
||||||
return false
|
return false
|
||||||
|
|
||||||
|
func on_pickup(type, amount):
|
||||||
|
for s in STORAGES:
|
||||||
|
if s.currentType == type:
|
||||||
|
if s.currentStashValue + amount <= s.maxStashValue:
|
||||||
|
s.currentStashValue += amount
|
||||||
|
else:
|
||||||
|
s.currentStashValue = s.maxStashValue
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user