brick3.gd 517 B

123456789101112131415161718192021222324
  1. extends RigidBody2D
  2. # Declare member variables here. Examples:
  3. # var a = 2
  4. # var b = "text"
  5. # Called when the node enters the scene tree for the first time.
  6. func _ready():
  7. connect("body_entered",self,"on_entered")
  8. pass # Replace with function body.
  9. func on_entered(body):
  10. print("contact with", body, body.name)
  11. if body.name == 'ground':
  12. self.queue_free()
  13. print("OFFENDER WON")
  14. get_tree().quit()
  15. # Called every frame. 'delta' is the elapsed time since the previous frame.
  16. #func _process(delta):
  17. # pass