rock.gd 286 B

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