Audio: mood music, ambience, sound effects and creature voices (Kenney CC0 + synthesised); protocol 13
This commit is contained in:
@@ -147,6 +147,9 @@ func _ready() -> void:
|
||||
hud.bind(player)
|
||||
if not menu_mode and not server_mode:
|
||||
player.survival.died.connect(_on_player_died)
|
||||
player.survival.hurt.connect(func(_amount, _from): Sfx.me("hurt"))
|
||||
if not server_mode:
|
||||
Music.start(self) # (the title screen's backdrop world too: calm music)
|
||||
if Saves.has_world() and not menu_mode and not server_mode:
|
||||
# Save on window close instead of quitting straight away.
|
||||
get_tree().auto_accept_quit = false
|
||||
@@ -188,6 +191,7 @@ func heat_at(pos: Vector3, holder: Node = null) -> float:
|
||||
## wake up at the island start. The world carries on.
|
||||
func _on_player_died() -> void:
|
||||
Hints.event("died")
|
||||
Sfx.me("death")
|
||||
var pos := player.global_position
|
||||
pos.y = terrain.sample_height(pos.x, pos.z)
|
||||
if pos.y < terrain.water_level:
|
||||
@@ -247,6 +251,7 @@ func respawn_after_death() -> void:
|
||||
## Online: the server says we died. Same screen; Respawn asks the server.
|
||||
func died_online(text: String, has_items: bool, to_bed: bool, penalty: String = "grave") -> void:
|
||||
Hints.event("died")
|
||||
Sfx.me("death")
|
||||
dead_waiting = true
|
||||
player.velocity = Vector3.ZERO
|
||||
player.set_physics_process(false)
|
||||
@@ -561,6 +566,7 @@ func _exit_tree() -> void:
|
||||
Guide.stop()
|
||||
if Hints.world == self:
|
||||
Hints.stop()
|
||||
Music.stop(self)
|
||||
|
||||
func _notification(what: int) -> void:
|
||||
if what != NOTIFICATION_WM_CLOSE_REQUEST or menu_mode:
|
||||
|
||||
Reference in New Issue
Block a user