Files
godot-demo-projects/networking/webrtc_minimal/main.gd
A Thousand Ships 0343cedd48 General proofreading (#1262)
* General proofreading for grammar and spelling
* General formatting
* Addition of appropriate literals where appropriate, i.e. `&"foo"` for `StringName` cases and `^"foo/bar"` for `NodePath` cases
2025-10-11 01:39:59 -07:00

18 lines
440 B
GDScript

extends Node
const Chat = preload("res://chat.gd")
func _ready() -> void:
var p1 := Chat.new()
var p2 := Chat.new()
add_child(p1)
add_child(p2)
# Wait one second and send message from P1.
await get_tree().create_timer(1.0).timeout
p1.send_message("Hi from %s" % String(p1.get_path()))
# Wait one second and send message from P2.
await get_tree().create_timer(1.0).timeout
p2.send_message("Hi from %s" % String(p2.get_path()))