RingOfRaces/Global_InGame.gd

15 lines
507 B
GDScript3
Raw Normal View History

2021-05-28 21:01:56 +00:00
extends Node2D
2022-10-13 15:35:43 +00:00
const game_variables = "res://MiscScenes/GameVariables.tscn"
2021-05-28 21:01:56 +00:00
func RenderSpeech(load_on, text):
var speech = preload("res://MiscScenes/Speech.tscn").instance()
2021-05-28 21:01:56 +00:00
speech.bubble_text = text
speech.set_position(Vector2(0,-40))
2021-06-04 20:57:48 +00:00
load_on.add_child(speech)
func SoundOnInteraction(load_on, sound_name):
2022-10-13 15:35:43 +00:00
var audio = preload(game_variables).instance()
audio.get_node("Sound").stream = load("res://Sounds/%s.wav" % sound_name)
load_on.add_child(audio)
2022-10-13 15:09:42 +00:00
Global.Log("Sound playing "+sound_name, 1)