add pause screen
This commit is contained in:
parent
1d76d93aed
commit
74288e3ec6
8 changed files with 27 additions and 4 deletions
|
@ -5,6 +5,12 @@ func _ready():
|
|||
get_tree().paused = true
|
||||
$Body/Resume.grab_focus()
|
||||
|
||||
func _physics_process(delta):
|
||||
print(get_tree().paused)
|
||||
#Resume with pause button
|
||||
if Input.is_action_just_pressed("pause"):
|
||||
get_tree().paused = false
|
||||
queue_free()
|
||||
|
||||
func _on_Resume_pressed():
|
||||
get_tree().paused = false
|
||||
|
@ -13,7 +19,11 @@ func _on_Resume_pressed():
|
|||
|
||||
func _on_Restart_pressed():
|
||||
Game.call_deferred("restart_level")
|
||||
get_tree().paused = false
|
||||
queue_free()
|
||||
|
||||
|
||||
func _on_ExitLevel_pressed():
|
||||
get_tree().paused = false
|
||||
Game.change_map(load("res://maps/level_select.tscn"))
|
||||
queue_free()
|
||||
|
|
|
@ -85,6 +85,8 @@ margin_bottom = 41.0
|
|||
focus_neighbour_top = NodePath("../Settings")
|
||||
texture_focused = ExtResource( 3 )
|
||||
|
||||
[node name="StaticBody2D" type="StaticBody2D" parent="."]
|
||||
|
||||
[connection signal="pressed" from="Body/Resume" to="." method="_on_Resume_pressed"]
|
||||
[connection signal="pressed" from="Body/Restart" to="." method="_on_Restart_pressed"]
|
||||
[connection signal="pressed" from="Body/ExitLevel" to="." method="_on_ExitLevel_pressed"]
|
||||
|
|
|
@ -29,8 +29,6 @@ var can_doublejump = true
|
|||
var can_move_in_air = false
|
||||
#Positions
|
||||
var arrowpos = Vector2(5,3)
|
||||
#Tiles
|
||||
onready var deathtiles = map.get_node("Death")
|
||||
##Preload
|
||||
var pre_arrow = preload("res://objects/player/arrow_projectile.tscn")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue