rock.gd 290 B

123456789101112
  1. extends KinematicBody2D
  2. # Sent to everyone else
  3. slave func do_explosion():
  4. get_node("anim").play("explode")
  5. # Received by owner of the rock
  6. master func exploded(by_who):
  7. rpc("do_explosion") # Re-sent to slave rocks
  8. get_node("../../score").rpc("increase_score", by_who)
  9. do_explosion()