Skip to content

Commit 73cffe9

Browse files
authored
Merge pull request #2051 from endlessm/cinematic-and-spawnpoint-improvements
Improvements for Cinematic and SpawnPoint nodes
2 parents e318469 + dbe675c commit 73cffe9

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

scenes/game_elements/props/spawn_point/components/spawn_point.gd

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
class_name SpawnPoint
55
extends Marker2D
66

7+
## Emitted after the player position has been changed.
8+
## [br][br]
9+
## Level scenes can use this signal to behave differently depending on
10+
## which SpawnPoint was used (or if no SpawnPoint at all was used).
11+
signal player_teleported
12+
713
@export var look_at_side_on_spawn: Enums.LookAtSide = Enums.LookAtSide.UNSPECIFIED
814

915

@@ -24,3 +30,5 @@ func move_player_to_self_position(smooth_camera: bool = false) -> void:
2430

2531
if is_instance_valid(player):
2632
player.teleport_to(self.global_position, smooth_camera, look_at_side_on_spawn)
33+
34+
player_teleported.emit()

scenes/ui_elements/cinematic/cinematic.gd

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,16 @@ signal cinematic_finished
2525
## leave this blank.
2626
@export var spawn_point_path: String
2727

28+
## Wether to automatically start the cinematic.
29+
@export var autostart: bool = true
30+
2831

2932
func _ready() -> void:
33+
if autostart:
34+
start()
35+
36+
37+
func start() -> void:
3038
if not GameState.intro_dialogue_shown:
3139
DialogueManager.show_dialogue_balloon(dialogue, "", [self])
3240
await DialogueManager.dialogue_ended

0 commit comments

Comments
 (0)