Files
godot-demo-projects/networking/multiplayer_bomber/rock.gd
2021-03-03 02:59:17 -05:00

13 lines
286 B
GDScript

extends KinematicBody2D
# Sent to everyone else
puppet func do_explosion():
$"AnimationPlayer".play("explode")
# Received by owner of the rock
master func exploded(by_who):
rpc("do_explosion") # Re-sent to puppet rocks
$"../../Score".rpc("increase_score", by_who)
do_explosion()