diff --git a/src/main.gd b/src/main.gd index 1957234..edc9446 100644 --- a/src/main.gd +++ b/src/main.gd @@ -52,8 +52,14 @@ func _process(_delta: float) -> void: currently_loading_room = "" room_loaded.emit() - if Input.is_action_just_pressed("ui_menu") and in_game: - toggle_pause_menu() + if Input.is_action_just_pressed("reset_demo") and (OS.has_feature("demo") or true): + State.stage_list = [self] + _return_to_menu() + +func _unhandled_input(event: InputEvent) -> void: + if event is InputEvent and in_game: + if event.is_action_pressed("ui_menu"): + toggle_pause_menu() func toggle_pause_menu(): if not get_tree().paused: @@ -121,5 +127,11 @@ func get_room_path_from_id(id: State.rooms) -> String: _: return ending_path +func start_demo(): + #FIXME this causes the room to reload + #load_save(SaveGame.new()) + current_room.start_room() + in_game = true + func pause_mode_changed(): print(get_tree().paused)