Added pause menu with recipes
This commit is contained in:
parent
1b389fc07a
commit
d8cdc48c01
Binary file not shown.
BIN
assets/tutorial/item_recipes.png
Normal file
BIN
assets/tutorial/item_recipes.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.3 KiB |
35
assets/tutorial/item_recipes.png.import
Normal file
35
assets/tutorial/item_recipes.png.import
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="StreamTexture"
|
||||||
|
path="res://.import/item_recipes.png-907ab7408764d4990d37a0163ed0578b.stex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://assets/tutorial/item_recipes.png"
|
||||||
|
dest_files=[ "res://.import/item_recipes.png-907ab7408764d4990d37a0163ed0578b.stex" ]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_mode=0
|
||||||
|
compress/bptc_ldr=0
|
||||||
|
compress/normal_map=0
|
||||||
|
flags/repeat=0
|
||||||
|
flags/filter=true
|
||||||
|
flags/mipmaps=false
|
||||||
|
flags/anisotropic=false
|
||||||
|
flags/srgb=2
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/HDR_as_SRGB=false
|
||||||
|
process/invert_color=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
stream=false
|
||||||
|
size_limit=0
|
||||||
|
detect_3d=true
|
||||||
|
svg/scale=1.0
|
BIN
assets/tutorial/machine_repair.png
Normal file
BIN
assets/tutorial/machine_repair.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 492 KiB |
35
assets/tutorial/machine_repair.png.import
Normal file
35
assets/tutorial/machine_repair.png.import
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="StreamTexture"
|
||||||
|
path="res://.import/machine_repair.png-2fbf76229e517b31efe6af8169865532.stex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://assets/tutorial/machine_repair.png"
|
||||||
|
dest_files=[ "res://.import/machine_repair.png-2fbf76229e517b31efe6af8169865532.stex" ]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_mode=0
|
||||||
|
compress/bptc_ldr=0
|
||||||
|
compress/normal_map=0
|
||||||
|
flags/repeat=0
|
||||||
|
flags/filter=true
|
||||||
|
flags/mipmaps=false
|
||||||
|
flags/anisotropic=false
|
||||||
|
flags/srgb=2
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/HDR_as_SRGB=false
|
||||||
|
process/invert_color=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
stream=false
|
||||||
|
size_limit=0
|
||||||
|
detect_3d=true
|
||||||
|
svg/scale=1.0
|
@ -186,6 +186,12 @@ open_debug={
|
|||||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":46,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
|
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":46,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
pause_game={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":0,"physical_scancode":16777217,"unicode":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":11,"pressure":0.0,"pressed":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
[layer_names]
|
[layer_names]
|
||||||
|
|
||||||
|
@ -1,14 +1,73 @@
|
|||||||
[gd_scene load_steps=2 format=2]
|
[gd_scene load_steps=4 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://scripts/game_manager.gd" type="Script" id=1]
|
[ext_resource path="res://scripts/game_manager.gd" type="Script" id=1]
|
||||||
|
[ext_resource path="res://assets/tutorial/item_recipes.png" type="Texture" id=2]
|
||||||
|
[ext_resource path="res://assets/tutorial/machine_repair.png" type="Texture" id=3]
|
||||||
|
|
||||||
[node name="game_manager" type="CanvasLayer" groups=["game_manager"]]
|
[node name="game_manager" type="CanvasLayer" groups=["game_manager"]]
|
||||||
|
pause_mode = 2
|
||||||
|
layer = 5
|
||||||
script = ExtResource( 1 )
|
script = ExtResource( 1 )
|
||||||
|
|
||||||
[node name="UI" type="Control" parent="."]
|
[node name="UI" type="Control" parent="."]
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
rect_pivot_offset = Vector2( 1024, 600 )
|
rect_pivot_offset = Vector2( 1024, 600 )
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
size_flags_vertical = 3
|
||||||
|
|
||||||
|
[node name="pause_menu" type="Panel" parent="UI"]
|
||||||
|
pause_mode = 2
|
||||||
|
unique_name_in_owner = true
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
rect_pivot_offset = Vector2( 989, 509 )
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
size_flags_vertical = 3
|
||||||
|
|
||||||
|
[node name="resume_button" type="Button" parent="UI/pause_menu"]
|
||||||
|
pause_mode = 2
|
||||||
|
unique_name_in_owner = true
|
||||||
|
anchor_left = 0.5
|
||||||
|
anchor_top = 1.0
|
||||||
|
anchor_right = 0.5
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
margin_top = -171.0
|
||||||
|
margin_right = 63.0
|
||||||
|
margin_bottom = -151.0
|
||||||
|
rect_scale = Vector2( 4, 4 )
|
||||||
|
rect_pivot_offset = Vector2( 30.7864, 9.2928 )
|
||||||
|
text = "RESUME"
|
||||||
|
icon_align = 1
|
||||||
|
expand_icon = true
|
||||||
|
|
||||||
|
[node name="machine_repair" type="TextureRect" parent="UI/pause_menu"]
|
||||||
|
anchor_left = 0.532812
|
||||||
|
anchor_top = 0.191667
|
||||||
|
anchor_right = 0.960938
|
||||||
|
anchor_bottom = 0.762037
|
||||||
|
margin_left = 6.10352e-05
|
||||||
|
rect_pivot_offset = Vector2( -754, 325 )
|
||||||
|
texture = ExtResource( 3 )
|
||||||
|
expand = true
|
||||||
|
stretch_mode = 1
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_use_anchors_": true
|
||||||
|
}
|
||||||
|
|
||||||
|
[node name="item_recipe" type="TextureRect" parent="UI/pause_menu"]
|
||||||
|
anchor_left = 0.043
|
||||||
|
anchor_top = 0.27
|
||||||
|
anchor_right = 0.49
|
||||||
|
anchor_bottom = 0.718
|
||||||
|
margin_left = -0.560005
|
||||||
|
margin_top = 0.399994
|
||||||
|
margin_right = 0.199951
|
||||||
|
margin_bottom = -0.440063
|
||||||
|
rect_pivot_offset = Vector2( 1777, -206.5 )
|
||||||
|
texture = ExtResource( 2 )
|
||||||
|
expand = true
|
||||||
|
stretch_mode = 6
|
||||||
|
|
||||||
[node name="day_timer_text" type="Label" parent="UI"]
|
[node name="day_timer_text" type="Label" parent="UI"]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
@ -25,6 +84,8 @@ align = 2
|
|||||||
uppercase = true
|
uppercase = true
|
||||||
|
|
||||||
[node name="day_timer" type="Timer" parent="."]
|
[node name="day_timer" type="Timer" parent="."]
|
||||||
|
pause_mode = 1
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
|
|
||||||
|
[connection signal="pressed" from="UI/pause_menu/resume_button" to="." method="_on_resume_button_pressed"]
|
||||||
[connection signal="timeout" from="day_timer" to="." method="_on_day_timer_timeout"]
|
[connection signal="timeout" from="day_timer" to="." method="_on_day_timer_timeout"]
|
||||||
|
@ -250,9 +250,6 @@ script = ExtResource( 8 )
|
|||||||
target = NodePath("../Player")
|
target = NodePath("../Player")
|
||||||
size = 4.0
|
size = 4.0
|
||||||
|
|
||||||
[node name="game_manager" parent="." instance=ExtResource( 7 )]
|
|
||||||
time_per_day = 300.0
|
|
||||||
|
|
||||||
[node name="power_station" parent="." instance=ExtResource( 14 )]
|
[node name="power_station" parent="." instance=ExtResource( 14 )]
|
||||||
transform = Transform( 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 1, 0 )
|
transform = Transform( 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 1, 0 )
|
||||||
time_to_generate = 5.0
|
time_to_generate = 5.0
|
||||||
@ -402,9 +399,14 @@ transform = Transform( -0.707107, 0, 0.707107, 0, 1, 0, -0.707107, 0, -0.707107,
|
|||||||
start_broken = true
|
start_broken = true
|
||||||
|
|
||||||
[node name="CanvasLayer" type="CanvasLayer" parent="."]
|
[node name="CanvasLayer" type="CanvasLayer" parent="."]
|
||||||
|
pause_mode = 1
|
||||||
|
visible = false
|
||||||
|
|
||||||
[node name="cheat_menu" parent="CanvasLayer" instance=ExtResource( 18 )]
|
[node name="cheat_menu" parent="CanvasLayer" instance=ExtResource( 18 )]
|
||||||
|
|
||||||
|
[node name="game_manager" parent="." instance=ExtResource( 7 )]
|
||||||
|
time_per_day = 300.0
|
||||||
|
|
||||||
[connection signal="player_entered" from="cameras/camera_room_center" to="cameras" method="_on_camera_room_player_entered"]
|
[connection signal="player_entered" from="cameras/camera_room_center" to="cameras" method="_on_camera_room_player_entered"]
|
||||||
[connection signal="player_exited" from="cameras/camera_room_center" to="cameras" method="_on_camera_room_player_exited"]
|
[connection signal="player_exited" from="cameras/camera_room_center" to="cameras" method="_on_camera_room_player_exited"]
|
||||||
[connection signal="area_entered" from="cameras/camera_room_center/hitbox" to="cameras/camera_room_center" method="_on_hitbox_area_entered"]
|
[connection signal="area_entered" from="cameras/camera_room_center/hitbox" to="cameras/camera_room_center" method="_on_hitbox_area_entered"]
|
||||||
|
@ -714,7 +714,7 @@ mesh = SubResource( 1 )
|
|||||||
skin = SubResource( 2 )
|
skin = SubResource( 2 )
|
||||||
|
|
||||||
[node name="head_bone" type="BoneAttachment" parent="model_transform/DungMan/Armature/Skeleton" index="1"]
|
[node name="head_bone" type="BoneAttachment" parent="model_transform/DungMan/Armature/Skeleton" index="1"]
|
||||||
transform = Transform( 1, -2.20707e-16, -2.35891e-17, 2.74492e-19, -0.105045, 0.994467, -2.21964e-16, -0.994467, -0.105045, -3.31838e-16, -0.0380623, -1.50372 )
|
transform = Transform( 1, -2.22118e-16, -9.47951e-19, -2.04242e-19, -0.00518723, 0.999986, -2.2212e-16, -0.999986, -0.00518723, -3.33247e-16, 0.00719897, -1.50005 )
|
||||||
bone_name = "Item"
|
bone_name = "Item"
|
||||||
|
|
||||||
[node name="ItemSpawn" type="Spatial" parent="model_transform/DungMan/Armature/Skeleton/head_bone"]
|
[node name="ItemSpawn" type="Spatial" parent="model_transform/DungMan/Armature/Skeleton/head_bone"]
|
||||||
@ -774,14 +774,17 @@ pause_mode = 2
|
|||||||
[node name="Control" type="Control" parent="UI"]
|
[node name="Control" type="Control" parent="UI"]
|
||||||
margin_right = 40.0
|
margin_right = 40.0
|
||||||
margin_bottom = 40.0
|
margin_bottom = 40.0
|
||||||
|
mouse_filter = 2
|
||||||
|
|
||||||
[node name="TextureRect" type="TextureRect" parent="UI/Control"]
|
[node name="TextureRect" type="TextureRect" parent="UI/Control"]
|
||||||
margin_right = 565.0
|
margin_right = 565.0
|
||||||
margin_bottom = 164.0
|
margin_bottom = 164.0
|
||||||
|
mouse_filter = 2
|
||||||
texture = SubResource( 21 )
|
texture = SubResource( 21 )
|
||||||
expand = true
|
expand = true
|
||||||
|
|
||||||
[node name="MarginContainer" type="MarginContainer" parent="UI/Control"]
|
[node name="MarginContainer" type="MarginContainer" parent="UI/Control"]
|
||||||
|
mouse_filter = 2
|
||||||
custom_constants/margin_right = 16
|
custom_constants/margin_right = 16
|
||||||
custom_constants/margin_top = 16
|
custom_constants/margin_top = 16
|
||||||
custom_constants/margin_left = 16
|
custom_constants/margin_left = 16
|
||||||
@ -793,12 +796,14 @@ margin_left = 16.0
|
|||||||
margin_top = 16.0
|
margin_top = 16.0
|
||||||
margin_right = 540.0
|
margin_right = 540.0
|
||||||
margin_bottom = 144.0
|
margin_bottom = 144.0
|
||||||
|
mouse_filter = 2
|
||||||
|
|
||||||
[node name="stomach0" type="TextureRect" parent="UI/Control/MarginContainer/stomachs"]
|
[node name="stomach0" type="TextureRect" parent="UI/Control/MarginContainer/stomachs"]
|
||||||
material = SubResource( 28 )
|
material = SubResource( 28 )
|
||||||
margin_right = 128.0
|
margin_right = 128.0
|
||||||
margin_bottom = 128.0
|
margin_bottom = 128.0
|
||||||
rect_pivot_offset = Vector2( 128, 821 )
|
rect_pivot_offset = Vector2( 128, 821 )
|
||||||
|
mouse_filter = 2
|
||||||
texture = ExtResource( 3 )
|
texture = ExtResource( 3 )
|
||||||
|
|
||||||
[node name="stomach1" type="TextureRect" parent="UI/Control/MarginContainer/stomachs"]
|
[node name="stomach1" type="TextureRect" parent="UI/Control/MarginContainer/stomachs"]
|
||||||
@ -807,6 +812,7 @@ margin_left = 132.0
|
|||||||
margin_right = 260.0
|
margin_right = 260.0
|
||||||
margin_bottom = 128.0
|
margin_bottom = 128.0
|
||||||
rect_pivot_offset = Vector2( 128, 821 )
|
rect_pivot_offset = Vector2( 128, 821 )
|
||||||
|
mouse_filter = 2
|
||||||
texture = ExtResource( 3 )
|
texture = ExtResource( 3 )
|
||||||
|
|
||||||
[node name="stomach2" type="TextureRect" parent="UI/Control/MarginContainer/stomachs"]
|
[node name="stomach2" type="TextureRect" parent="UI/Control/MarginContainer/stomachs"]
|
||||||
@ -815,6 +821,7 @@ margin_left = 264.0
|
|||||||
margin_right = 392.0
|
margin_right = 392.0
|
||||||
margin_bottom = 128.0
|
margin_bottom = 128.0
|
||||||
rect_pivot_offset = Vector2( 128, 821 )
|
rect_pivot_offset = Vector2( 128, 821 )
|
||||||
|
mouse_filter = 2
|
||||||
texture = ExtResource( 3 )
|
texture = ExtResource( 3 )
|
||||||
|
|
||||||
[node name="stomach3" type="TextureRect" parent="UI/Control/MarginContainer/stomachs"]
|
[node name="stomach3" type="TextureRect" parent="UI/Control/MarginContainer/stomachs"]
|
||||||
@ -823,12 +830,14 @@ margin_left = 396.0
|
|||||||
margin_right = 524.0
|
margin_right = 524.0
|
||||||
margin_bottom = 128.0
|
margin_bottom = 128.0
|
||||||
rect_pivot_offset = Vector2( 128, 821 )
|
rect_pivot_offset = Vector2( 128, 821 )
|
||||||
|
mouse_filter = 2
|
||||||
texture = ExtResource( 3 )
|
texture = ExtResource( 3 )
|
||||||
|
|
||||||
[node name="blackout" type="ColorRect" parent="UI"]
|
[node name="blackout" type="ColorRect" parent="UI"]
|
||||||
modulate = Color( 1, 1, 1, 0 )
|
modulate = Color( 1, 1, 1, 0 )
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
|
mouse_filter = 2
|
||||||
color = Color( 0, 0, 0, 1 )
|
color = Color( 0, 0, 0, 1 )
|
||||||
|
|
||||||
[node name="ZZZ" type="Label" parent="UI"]
|
[node name="ZZZ" type="Label" parent="UI"]
|
||||||
|
@ -5,6 +5,7 @@ export var time_per_day : float = 600.0
|
|||||||
onready var player = get_tree().get_nodes_in_group("player")[0]
|
onready var player = get_tree().get_nodes_in_group("player")[0]
|
||||||
onready var day_timer = $"%day_timer"
|
onready var day_timer = $"%day_timer"
|
||||||
onready var day_timer_text = $"%day_timer_text"
|
onready var day_timer_text = $"%day_timer_text"
|
||||||
|
onready var pause_menu = $"%pause_menu"
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
player.connect("starved_to_death", self, "_on_player_starved_to_death")
|
player.connect("starved_to_death", self, "_on_player_starved_to_death")
|
||||||
@ -17,6 +18,10 @@ func _process(delta):
|
|||||||
var seconds : int = time_left % 60
|
var seconds : int = time_left % 60
|
||||||
day_timer_text.text = "Time Left: %0*d:%0*d" % [2, minutes, 2, seconds]
|
day_timer_text.text = "Time Left: %0*d:%0*d" % [2, minutes, 2, seconds]
|
||||||
|
|
||||||
|
func _unhandled_input(event):
|
||||||
|
if event.is_action_pressed("pause_game"):
|
||||||
|
toggle_pause_menu()
|
||||||
|
|
||||||
func _on_player_starved_to_death():
|
func _on_player_starved_to_death():
|
||||||
var node = Dialogic.start("starve")
|
var node = Dialogic.start("starve")
|
||||||
node.pause_mode = PAUSE_MODE_PROCESS
|
node.pause_mode = PAUSE_MODE_PROCESS
|
||||||
@ -31,3 +36,10 @@ func reset_day_timer():
|
|||||||
|
|
||||||
func _on_day_timer_timeout():
|
func _on_day_timer_timeout():
|
||||||
player.sleep(false, null)
|
player.sleep(false, null)
|
||||||
|
|
||||||
|
func toggle_pause_menu():
|
||||||
|
pause_menu.visible = !pause_menu.visible
|
||||||
|
get_tree().paused = pause_menu.visible
|
||||||
|
|
||||||
|
func _on_resume_button_pressed():
|
||||||
|
toggle_pause_menu()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user