Ver código fonte

:sparkles: intro can be skipped with escape

Felix Bytow 10 meses atrás
pai
commit
6031c2dbbe
2 arquivos alterados com 4 adições e 2 exclusões
  1. 1 1
      assets/scenes/intro.tscn
  2. 3 1
      screens/game.gd

+ 1 - 1
assets/scenes/intro.tscn

@@ -58,7 +58,7 @@ animations = [{
 "speed": 0.7
 }]
 
-[node name="Intro" type="Node2D"]
+[node name="Intro" type="Node2D" groups=["intro"]]
 z_index = 3000
 script = ExtResource("1_f6nbx")
 

+ 3 - 1
screens/game.gd

@@ -104,7 +104,9 @@ func _ready() -> void:
 		)
 
 func _process(_delta: float) -> void:
-	if Input.is_action_pressed("ui_cancel"):
+	var intro_visible: bool = get_tree().get_first_node_in_group("intro") != null
+	
+	if Input.is_action_pressed("ui_cancel") && not intro_visible:
 		go_to_main_menu()
 	if phase == Phase.PHASE_COMBAT:
 		if get_foes().is_empty() and health_bar.health != 0: